Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

16518 rader
569 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package androidenterprise provides access to the Google Play EMM API.
  6. //
  7. // For product documentation, see: https://developers.google.com/android/work/play/emm-api
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/androidenterprise/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // androidenterpriseService, err := androidenterprise.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // androidenterpriseService, err := androidenterprise.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // androidenterpriseService, err := androidenterprise.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package androidenterprise // import "google.golang.org/api/androidenterprise/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "androidenterprise:v1"
  67. const apiName = "androidenterprise"
  68. const apiVersion = "v1"
  69. const basePath = "https://www.googleapis.com/androidenterprise/v1/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // Manage corporate Android devices
  73. AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/androidenterprise",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Devices = NewDevicesService(s)
  106. s.Enterprises = NewEnterprisesService(s)
  107. s.Entitlements = NewEntitlementsService(s)
  108. s.Grouplicenses = NewGrouplicensesService(s)
  109. s.Grouplicenseusers = NewGrouplicenseusersService(s)
  110. s.Installs = NewInstallsService(s)
  111. s.Managedconfigurationsfordevice = NewManagedconfigurationsfordeviceService(s)
  112. s.Managedconfigurationsforuser = NewManagedconfigurationsforuserService(s)
  113. s.Managedconfigurationssettings = NewManagedconfigurationssettingsService(s)
  114. s.Permissions = NewPermissionsService(s)
  115. s.Products = NewProductsService(s)
  116. s.Serviceaccountkeys = NewServiceaccountkeysService(s)
  117. s.Storelayoutclusters = NewStorelayoutclustersService(s)
  118. s.Storelayoutpages = NewStorelayoutpagesService(s)
  119. s.Users = NewUsersService(s)
  120. s.Webapps = NewWebappsService(s)
  121. return s, nil
  122. }
  123. type Service struct {
  124. client *http.Client
  125. BasePath string // API endpoint base URL
  126. UserAgent string // optional additional User-Agent fragment
  127. Devices *DevicesService
  128. Enterprises *EnterprisesService
  129. Entitlements *EntitlementsService
  130. Grouplicenses *GrouplicensesService
  131. Grouplicenseusers *GrouplicenseusersService
  132. Installs *InstallsService
  133. Managedconfigurationsfordevice *ManagedconfigurationsfordeviceService
  134. Managedconfigurationsforuser *ManagedconfigurationsforuserService
  135. Managedconfigurationssettings *ManagedconfigurationssettingsService
  136. Permissions *PermissionsService
  137. Products *ProductsService
  138. Serviceaccountkeys *ServiceaccountkeysService
  139. Storelayoutclusters *StorelayoutclustersService
  140. Storelayoutpages *StorelayoutpagesService
  141. Users *UsersService
  142. Webapps *WebappsService
  143. }
  144. func (s *Service) userAgent() string {
  145. if s.UserAgent == "" {
  146. return googleapi.UserAgent
  147. }
  148. return googleapi.UserAgent + " " + s.UserAgent
  149. }
  150. func NewDevicesService(s *Service) *DevicesService {
  151. rs := &DevicesService{s: s}
  152. return rs
  153. }
  154. type DevicesService struct {
  155. s *Service
  156. }
  157. func NewEnterprisesService(s *Service) *EnterprisesService {
  158. rs := &EnterprisesService{s: s}
  159. return rs
  160. }
  161. type EnterprisesService struct {
  162. s *Service
  163. }
  164. func NewEntitlementsService(s *Service) *EntitlementsService {
  165. rs := &EntitlementsService{s: s}
  166. return rs
  167. }
  168. type EntitlementsService struct {
  169. s *Service
  170. }
  171. func NewGrouplicensesService(s *Service) *GrouplicensesService {
  172. rs := &GrouplicensesService{s: s}
  173. return rs
  174. }
  175. type GrouplicensesService struct {
  176. s *Service
  177. }
  178. func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService {
  179. rs := &GrouplicenseusersService{s: s}
  180. return rs
  181. }
  182. type GrouplicenseusersService struct {
  183. s *Service
  184. }
  185. func NewInstallsService(s *Service) *InstallsService {
  186. rs := &InstallsService{s: s}
  187. return rs
  188. }
  189. type InstallsService struct {
  190. s *Service
  191. }
  192. func NewManagedconfigurationsfordeviceService(s *Service) *ManagedconfigurationsfordeviceService {
  193. rs := &ManagedconfigurationsfordeviceService{s: s}
  194. return rs
  195. }
  196. type ManagedconfigurationsfordeviceService struct {
  197. s *Service
  198. }
  199. func NewManagedconfigurationsforuserService(s *Service) *ManagedconfigurationsforuserService {
  200. rs := &ManagedconfigurationsforuserService{s: s}
  201. return rs
  202. }
  203. type ManagedconfigurationsforuserService struct {
  204. s *Service
  205. }
  206. func NewManagedconfigurationssettingsService(s *Service) *ManagedconfigurationssettingsService {
  207. rs := &ManagedconfigurationssettingsService{s: s}
  208. return rs
  209. }
  210. type ManagedconfigurationssettingsService struct {
  211. s *Service
  212. }
  213. func NewPermissionsService(s *Service) *PermissionsService {
  214. rs := &PermissionsService{s: s}
  215. return rs
  216. }
  217. type PermissionsService struct {
  218. s *Service
  219. }
  220. func NewProductsService(s *Service) *ProductsService {
  221. rs := &ProductsService{s: s}
  222. return rs
  223. }
  224. type ProductsService struct {
  225. s *Service
  226. }
  227. func NewServiceaccountkeysService(s *Service) *ServiceaccountkeysService {
  228. rs := &ServiceaccountkeysService{s: s}
  229. return rs
  230. }
  231. type ServiceaccountkeysService struct {
  232. s *Service
  233. }
  234. func NewStorelayoutclustersService(s *Service) *StorelayoutclustersService {
  235. rs := &StorelayoutclustersService{s: s}
  236. return rs
  237. }
  238. type StorelayoutclustersService struct {
  239. s *Service
  240. }
  241. func NewStorelayoutpagesService(s *Service) *StorelayoutpagesService {
  242. rs := &StorelayoutpagesService{s: s}
  243. return rs
  244. }
  245. type StorelayoutpagesService struct {
  246. s *Service
  247. }
  248. func NewUsersService(s *Service) *UsersService {
  249. rs := &UsersService{s: s}
  250. return rs
  251. }
  252. type UsersService struct {
  253. s *Service
  254. }
  255. func NewWebappsService(s *Service) *WebappsService {
  256. rs := &WebappsService{s: s}
  257. return rs
  258. }
  259. type WebappsService struct {
  260. s *Service
  261. }
  262. // Administrator: This represents an enterprise admin who can manage the
  263. // enterprise in the managed Google Play store.
  264. type Administrator struct {
  265. // Email: The admin's email address.
  266. Email string `json:"email,omitempty"`
  267. // ForceSendFields is a list of field names (e.g. "Email") to
  268. // unconditionally include in API requests. By default, fields with
  269. // empty values are omitted from API requests. However, any non-pointer,
  270. // non-interface field appearing in ForceSendFields will be sent to the
  271. // server regardless of whether the field is empty or not. This may be
  272. // used to include empty fields in Patch requests.
  273. ForceSendFields []string `json:"-"`
  274. // NullFields is a list of field names (e.g. "Email") to include in API
  275. // requests with the JSON null value. By default, fields with empty
  276. // values are omitted from API requests. However, any field with an
  277. // empty value appearing in NullFields will be sent to the server as
  278. // null. It is an error if a field in this list has a non-empty value.
  279. // This may be used to include null fields in Patch requests.
  280. NullFields []string `json:"-"`
  281. }
  282. func (s *Administrator) MarshalJSON() ([]byte, error) {
  283. type NoMethod Administrator
  284. raw := NoMethod(*s)
  285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  286. }
  287. // AdministratorWebToken: A token authorizing an admin to access an
  288. // iframe.
  289. type AdministratorWebToken struct {
  290. // Kind: Identifies what kind of resource this is. Value: the fixed
  291. // string "androidenterprise#administratorWebToken".
  292. Kind string `json:"kind,omitempty"`
  293. // Token: An opaque token to be passed to the Play front-end to generate
  294. // an iframe.
  295. Token string `json:"token,omitempty"`
  296. // ServerResponse contains the HTTP response code and headers from the
  297. // server.
  298. googleapi.ServerResponse `json:"-"`
  299. // ForceSendFields is a list of field names (e.g. "Kind") to
  300. // unconditionally include in API requests. By default, fields with
  301. // empty values are omitted from API requests. However, any non-pointer,
  302. // non-interface field appearing in ForceSendFields will be sent to the
  303. // server regardless of whether the field is empty or not. This may be
  304. // used to include empty fields in Patch requests.
  305. ForceSendFields []string `json:"-"`
  306. // NullFields is a list of field names (e.g. "Kind") to include in API
  307. // requests with the JSON null value. By default, fields with empty
  308. // values are omitted from API requests. However, any field with an
  309. // empty value appearing in NullFields will be sent to the server as
  310. // null. It is an error if a field in this list has a non-empty value.
  311. // This may be used to include null fields in Patch requests.
  312. NullFields []string `json:"-"`
  313. }
  314. func (s *AdministratorWebToken) MarshalJSON() ([]byte, error) {
  315. type NoMethod AdministratorWebToken
  316. raw := NoMethod(*s)
  317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  318. }
  319. // AdministratorWebTokenSpec: Specification for a token used to generate
  320. // iframes. The token specifies what data the admin is allowed to modify
  321. // and the URI the iframe is allowed to communiate with.
  322. type AdministratorWebTokenSpec struct {
  323. // Kind: Identifies what kind of resource this is. Value: the fixed
  324. // string "androidenterprise#administratorWebTokenSpec".
  325. Kind string `json:"kind,omitempty"`
  326. // ManagedConfigurations: Options for displaying the Managed
  327. // Configuration page.
  328. ManagedConfigurations *AdministratorWebTokenSpecManagedConfigurations `json:"managedConfigurations,omitempty"`
  329. // Parent: The URI of the parent frame hosting the iframe. To prevent
  330. // XSS, the iframe may not be hosted at other URIs. This URI must be
  331. // https.
  332. Parent string `json:"parent,omitempty"`
  333. // Permission: Deprecated. Use PlaySearch.approveApps.
  334. Permission []string `json:"permission,omitempty"`
  335. // PlaySearch: Options for displaying the managed Play Search apps page.
  336. PlaySearch *AdministratorWebTokenSpecPlaySearch `json:"playSearch,omitempty"`
  337. // PrivateApps: Options for displaying the Private Apps page.
  338. PrivateApps *AdministratorWebTokenSpecPrivateApps `json:"privateApps,omitempty"`
  339. // StoreBuilder: Options for displaying the Organize apps page.
  340. StoreBuilder *AdministratorWebTokenSpecStoreBuilder `json:"storeBuilder,omitempty"`
  341. // WebApps: Options for displaying the Web Apps page.
  342. WebApps *AdministratorWebTokenSpecWebApps `json:"webApps,omitempty"`
  343. // ForceSendFields is a list of field names (e.g. "Kind") to
  344. // unconditionally include in API requests. By default, fields with
  345. // empty values are omitted from API requests. However, any non-pointer,
  346. // non-interface field appearing in ForceSendFields will be sent to the
  347. // server regardless of whether the field is empty or not. This may be
  348. // used to include empty fields in Patch requests.
  349. ForceSendFields []string `json:"-"`
  350. // NullFields is a list of field names (e.g. "Kind") to include in API
  351. // requests with the JSON null value. By default, fields with empty
  352. // values are omitted from API requests. However, any field with an
  353. // empty value appearing in NullFields will be sent to the server as
  354. // null. It is an error if a field in this list has a non-empty value.
  355. // This may be used to include null fields in Patch requests.
  356. NullFields []string `json:"-"`
  357. }
  358. func (s *AdministratorWebTokenSpec) MarshalJSON() ([]byte, error) {
  359. type NoMethod AdministratorWebTokenSpec
  360. raw := NoMethod(*s)
  361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  362. }
  363. type AdministratorWebTokenSpecManagedConfigurations struct {
  364. // Enabled: Whether the Managed Configuration page is displayed. Default
  365. // is true.
  366. Enabled bool `json:"enabled,omitempty"`
  367. // ForceSendFields is a list of field names (e.g. "Enabled") to
  368. // unconditionally include in API requests. By default, fields with
  369. // empty values are omitted from API requests. However, any non-pointer,
  370. // non-interface field appearing in ForceSendFields will be sent to the
  371. // server regardless of whether the field is empty or not. This may be
  372. // used to include empty fields in Patch requests.
  373. ForceSendFields []string `json:"-"`
  374. // NullFields is a list of field names (e.g. "Enabled") to include in
  375. // API requests with the JSON null value. By default, fields with empty
  376. // values are omitted from API requests. However, any field with an
  377. // empty value appearing in NullFields will be sent to the server as
  378. // null. It is an error if a field in this list has a non-empty value.
  379. // This may be used to include null fields in Patch requests.
  380. NullFields []string `json:"-"`
  381. }
  382. func (s *AdministratorWebTokenSpecManagedConfigurations) MarshalJSON() ([]byte, error) {
  383. type NoMethod AdministratorWebTokenSpecManagedConfigurations
  384. raw := NoMethod(*s)
  385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  386. }
  387. type AdministratorWebTokenSpecPlaySearch struct {
  388. // ApproveApps: Allow access to the iframe in approve mode. Default is
  389. // false.
  390. ApproveApps bool `json:"approveApps,omitempty"`
  391. // Enabled: Whether the managed Play Search apps page is displayed.
  392. // Default is true.
  393. Enabled bool `json:"enabled,omitempty"`
  394. // ForceSendFields is a list of field names (e.g. "ApproveApps") to
  395. // unconditionally include in API requests. By default, fields with
  396. // empty values are omitted from API requests. However, any non-pointer,
  397. // non-interface field appearing in ForceSendFields will be sent to the
  398. // server regardless of whether the field is empty or not. This may be
  399. // used to include empty fields in Patch requests.
  400. ForceSendFields []string `json:"-"`
  401. // NullFields is a list of field names (e.g. "ApproveApps") to include
  402. // in API requests with the JSON null value. By default, fields with
  403. // empty values are omitted from API requests. However, any field with
  404. // an empty value appearing in NullFields will be sent to the server as
  405. // null. It is an error if a field in this list has a non-empty value.
  406. // This may be used to include null fields in Patch requests.
  407. NullFields []string `json:"-"`
  408. }
  409. func (s *AdministratorWebTokenSpecPlaySearch) MarshalJSON() ([]byte, error) {
  410. type NoMethod AdministratorWebTokenSpecPlaySearch
  411. raw := NoMethod(*s)
  412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  413. }
  414. type AdministratorWebTokenSpecPrivateApps struct {
  415. // Enabled: Whether the Private Apps page is displayed. Default is true.
  416. Enabled bool `json:"enabled,omitempty"`
  417. // ForceSendFields is a list of field names (e.g. "Enabled") to
  418. // unconditionally include in API requests. By default, fields with
  419. // empty values are omitted from API requests. However, any non-pointer,
  420. // non-interface field appearing in ForceSendFields will be sent to the
  421. // server regardless of whether the field is empty or not. This may be
  422. // used to include empty fields in Patch requests.
  423. ForceSendFields []string `json:"-"`
  424. // NullFields is a list of field names (e.g. "Enabled") to include in
  425. // API requests with the JSON null value. By default, fields with empty
  426. // values are omitted from API requests. However, any field with an
  427. // empty value appearing in NullFields will be sent to the server as
  428. // null. It is an error if a field in this list has a non-empty value.
  429. // This may be used to include null fields in Patch requests.
  430. NullFields []string `json:"-"`
  431. }
  432. func (s *AdministratorWebTokenSpecPrivateApps) MarshalJSON() ([]byte, error) {
  433. type NoMethod AdministratorWebTokenSpecPrivateApps
  434. raw := NoMethod(*s)
  435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  436. }
  437. type AdministratorWebTokenSpecStoreBuilder struct {
  438. // Enabled: Whether the Organize apps page is displayed. Default is
  439. // true.
  440. Enabled bool `json:"enabled,omitempty"`
  441. // ForceSendFields is a list of field names (e.g. "Enabled") to
  442. // unconditionally include in API requests. By default, fields with
  443. // empty values are omitted from API requests. However, any non-pointer,
  444. // non-interface field appearing in ForceSendFields will be sent to the
  445. // server regardless of whether the field is empty or not. This may be
  446. // used to include empty fields in Patch requests.
  447. ForceSendFields []string `json:"-"`
  448. // NullFields is a list of field names (e.g. "Enabled") to include in
  449. // API requests with the JSON null value. By default, fields with empty
  450. // values are omitted from API requests. However, any field with an
  451. // empty value appearing in NullFields will be sent to the server as
  452. // null. It is an error if a field in this list has a non-empty value.
  453. // This may be used to include null fields in Patch requests.
  454. NullFields []string `json:"-"`
  455. }
  456. func (s *AdministratorWebTokenSpecStoreBuilder) MarshalJSON() ([]byte, error) {
  457. type NoMethod AdministratorWebTokenSpecStoreBuilder
  458. raw := NoMethod(*s)
  459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  460. }
  461. type AdministratorWebTokenSpecWebApps struct {
  462. // Enabled: Whether the Web Apps page is displayed. Default is true.
  463. Enabled bool `json:"enabled,omitempty"`
  464. // ForceSendFields is a list of field names (e.g. "Enabled") to
  465. // unconditionally include in API requests. By default, fields with
  466. // empty values are omitted from API requests. However, any non-pointer,
  467. // non-interface field appearing in ForceSendFields will be sent to the
  468. // server regardless of whether the field is empty or not. This may be
  469. // used to include empty fields in Patch requests.
  470. ForceSendFields []string `json:"-"`
  471. // NullFields is a list of field names (e.g. "Enabled") to include in
  472. // API requests with the JSON null value. By default, fields with empty
  473. // values are omitted from API requests. However, any field with an
  474. // empty value appearing in NullFields will be sent to the server as
  475. // null. It is an error if a field in this list has a non-empty value.
  476. // This may be used to include null fields in Patch requests.
  477. NullFields []string `json:"-"`
  478. }
  479. func (s *AdministratorWebTokenSpecWebApps) MarshalJSON() ([]byte, error) {
  480. type NoMethod AdministratorWebTokenSpecWebApps
  481. raw := NoMethod(*s)
  482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  483. }
  484. // AndroidDevicePolicyConfig: Deprecated and unused.
  485. type AndroidDevicePolicyConfig struct {
  486. // Kind: Identifies what kind of resource this is. Value: the fixed
  487. // string "androidenterprise#androidDevicePolicyConfig".
  488. Kind string `json:"kind,omitempty"`
  489. // State: Deprecated and unused.
  490. State string `json:"state,omitempty"`
  491. // ServerResponse contains the HTTP response code and headers from the
  492. // server.
  493. googleapi.ServerResponse `json:"-"`
  494. // ForceSendFields is a list of field names (e.g. "Kind") to
  495. // unconditionally include in API requests. By default, fields with
  496. // empty values are omitted from API requests. However, any non-pointer,
  497. // non-interface field appearing in ForceSendFields will be sent to the
  498. // server regardless of whether the field is empty or not. This may be
  499. // used to include empty fields in Patch requests.
  500. ForceSendFields []string `json:"-"`
  501. // NullFields is a list of field names (e.g. "Kind") to include in API
  502. // requests with the JSON null value. By default, fields with empty
  503. // values are omitted from API requests. However, any field with an
  504. // empty value appearing in NullFields will be sent to the server as
  505. // null. It is an error if a field in this list has a non-empty value.
  506. // This may be used to include null fields in Patch requests.
  507. NullFields []string `json:"-"`
  508. }
  509. func (s *AndroidDevicePolicyConfig) MarshalJSON() ([]byte, error) {
  510. type NoMethod AndroidDevicePolicyConfig
  511. raw := NoMethod(*s)
  512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  513. }
  514. // AppRestrictionsSchema: Represents the list of app restrictions
  515. // available to be pre-configured for the product.
  516. type AppRestrictionsSchema struct {
  517. // Kind: Identifies what kind of resource this is. Value: the fixed
  518. // string "androidenterprise#appRestrictionsSchema".
  519. Kind string `json:"kind,omitempty"`
  520. // Restrictions: The set of restrictions that make up this schema.
  521. Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"`
  522. // ServerResponse contains the HTTP response code and headers from the
  523. // server.
  524. googleapi.ServerResponse `json:"-"`
  525. // ForceSendFields is a list of field names (e.g. "Kind") to
  526. // unconditionally include in API requests. By default, fields with
  527. // empty values are omitted from API requests. However, any non-pointer,
  528. // non-interface field appearing in ForceSendFields will be sent to the
  529. // server regardless of whether the field is empty or not. This may be
  530. // used to include empty fields in Patch requests.
  531. ForceSendFields []string `json:"-"`
  532. // NullFields is a list of field names (e.g. "Kind") to include in API
  533. // requests with the JSON null value. By default, fields with empty
  534. // values are omitted from API requests. However, any field with an
  535. // empty value appearing in NullFields will be sent to the server as
  536. // null. It is an error if a field in this list has a non-empty value.
  537. // This may be used to include null fields in Patch requests.
  538. NullFields []string `json:"-"`
  539. }
  540. func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) {
  541. type NoMethod AppRestrictionsSchema
  542. raw := NoMethod(*s)
  543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  544. }
  545. // AppRestrictionsSchemaChangeEvent: An event generated when a new app
  546. // version is uploaded to Google Play and its app restrictions schema
  547. // changed. To fetch the app restrictions schema for an app, use
  548. // Products.getAppRestrictionsSchema on the EMM API.
  549. type AppRestrictionsSchemaChangeEvent struct {
  550. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  551. // for which the app restriction schema changed. This field will always
  552. // be present.
  553. ProductId string `json:"productId,omitempty"`
  554. // ForceSendFields is a list of field names (e.g. "ProductId") to
  555. // unconditionally include in API requests. By default, fields with
  556. // empty values are omitted from API requests. However, any non-pointer,
  557. // non-interface field appearing in ForceSendFields will be sent to the
  558. // server regardless of whether the field is empty or not. This may be
  559. // used to include empty fields in Patch requests.
  560. ForceSendFields []string `json:"-"`
  561. // NullFields is a list of field names (e.g. "ProductId") to include in
  562. // API requests with the JSON null value. By default, fields with empty
  563. // values are omitted from API requests. However, any field with an
  564. // empty value appearing in NullFields will be sent to the server as
  565. // null. It is an error if a field in this list has a non-empty value.
  566. // This may be used to include null fields in Patch requests.
  567. NullFields []string `json:"-"`
  568. }
  569. func (s *AppRestrictionsSchemaChangeEvent) MarshalJSON() ([]byte, error) {
  570. type NoMethod AppRestrictionsSchemaChangeEvent
  571. raw := NoMethod(*s)
  572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  573. }
  574. // AppRestrictionsSchemaRestriction: A restriction in the App
  575. // Restriction Schema represents a piece of configuration that may be
  576. // pre-applied.
  577. type AppRestrictionsSchemaRestriction struct {
  578. // DefaultValue: The default value of the restriction. bundle and
  579. // bundleArray restrictions never have a default value.
  580. DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"`
  581. // Description: A longer description of the restriction, giving more
  582. // detail of what it affects.
  583. Description string `json:"description,omitempty"`
  584. // Entry: For choice or multiselect restrictions, the list of possible
  585. // entries' human-readable names.
  586. Entry []string `json:"entry,omitempty"`
  587. // EntryValue: For choice or multiselect restrictions, the list of
  588. // possible entries' machine-readable values. These values should be
  589. // used in the configuration, either as a single string value for a
  590. // choice restriction or in a stringArray for a multiselect restriction.
  591. EntryValue []string `json:"entryValue,omitempty"`
  592. // Key: The unique key that the product uses to identify the
  593. // restriction, e.g. "com.google.android.gm.fieldname".
  594. Key string `json:"key,omitempty"`
  595. // NestedRestriction: For bundle or bundleArray restrictions, the list
  596. // of nested restrictions. A bundle restriction is always nested within
  597. // a bundleArray restriction, and a bundleArray restriction is at most
  598. // two levels deep.
  599. NestedRestriction []*AppRestrictionsSchemaRestriction `json:"nestedRestriction,omitempty"`
  600. // RestrictionType: The type of the restriction.
  601. RestrictionType string `json:"restrictionType,omitempty"`
  602. // Title: The name of the restriction.
  603. Title string `json:"title,omitempty"`
  604. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  605. // unconditionally include in API requests. By default, fields with
  606. // empty values are omitted from API requests. However, any non-pointer,
  607. // non-interface field appearing in ForceSendFields will be sent to the
  608. // server regardless of whether the field is empty or not. This may be
  609. // used to include empty fields in Patch requests.
  610. ForceSendFields []string `json:"-"`
  611. // NullFields is a list of field names (e.g. "DefaultValue") to include
  612. // in API requests with the JSON null value. By default, fields with
  613. // empty values are omitted from API requests. However, any field with
  614. // an empty value appearing in NullFields will be sent to the server as
  615. // null. It is an error if a field in this list has a non-empty value.
  616. // This may be used to include null fields in Patch requests.
  617. NullFields []string `json:"-"`
  618. }
  619. func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) {
  620. type NoMethod AppRestrictionsSchemaRestriction
  621. raw := NoMethod(*s)
  622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  623. }
  624. // AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for
  625. // the restriction.
  626. type AppRestrictionsSchemaRestrictionRestrictionValue struct {
  627. // Type: The type of the value being provided.
  628. Type string `json:"type,omitempty"`
  629. // ValueBool: The boolean value - this will only be present if type is
  630. // bool.
  631. ValueBool bool `json:"valueBool,omitempty"`
  632. // ValueInteger: The integer value - this will only be present if type
  633. // is integer.
  634. ValueInteger int64 `json:"valueInteger,omitempty"`
  635. // ValueMultiselect: The list of string values - this will only be
  636. // present if type is multiselect.
  637. ValueMultiselect []string `json:"valueMultiselect,omitempty"`
  638. // ValueString: The string value - this will be present for types
  639. // string, choice and hidden.
  640. ValueString string `json:"valueString,omitempty"`
  641. // ForceSendFields is a list of field names (e.g. "Type") to
  642. // unconditionally include in API requests. By default, fields with
  643. // empty values are omitted from API requests. However, any non-pointer,
  644. // non-interface field appearing in ForceSendFields will be sent to the
  645. // server regardless of whether the field is empty or not. This may be
  646. // used to include empty fields in Patch requests.
  647. ForceSendFields []string `json:"-"`
  648. // NullFields is a list of field names (e.g. "Type") to include in API
  649. // requests with the JSON null value. By default, fields with empty
  650. // values are omitted from API requests. However, any field with an
  651. // empty value appearing in NullFields will be sent to the server as
  652. // null. It is an error if a field in this list has a non-empty value.
  653. // This may be used to include null fields in Patch requests.
  654. NullFields []string `json:"-"`
  655. }
  656. func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) {
  657. type NoMethod AppRestrictionsSchemaRestrictionRestrictionValue
  658. raw := NoMethod(*s)
  659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  660. }
  661. // AppUpdateEvent: An event generated when a new version of an app is
  662. // uploaded to Google Play. Notifications are sent for new public
  663. // versions only: alpha, beta, or canary versions do not generate this
  664. // event. To fetch up-to-date version history for an app, use
  665. // Products.Get on the EMM API.
  666. type AppUpdateEvent struct {
  667. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  668. // that was updated. This field will always be present.
  669. ProductId string `json:"productId,omitempty"`
  670. // ForceSendFields is a list of field names (e.g. "ProductId") to
  671. // unconditionally include in API requests. By default, fields with
  672. // empty values are omitted from API requests. However, any non-pointer,
  673. // non-interface field appearing in ForceSendFields will be sent to the
  674. // server regardless of whether the field is empty or not. This may be
  675. // used to include empty fields in Patch requests.
  676. ForceSendFields []string `json:"-"`
  677. // NullFields is a list of field names (e.g. "ProductId") to include in
  678. // API requests with the JSON null value. By default, fields with empty
  679. // values are omitted from API requests. However, any field with an
  680. // empty value appearing in NullFields will be sent to the server as
  681. // null. It is an error if a field in this list has a non-empty value.
  682. // This may be used to include null fields in Patch requests.
  683. NullFields []string `json:"-"`
  684. }
  685. func (s *AppUpdateEvent) MarshalJSON() ([]byte, error) {
  686. type NoMethod AppUpdateEvent
  687. raw := NoMethod(*s)
  688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  689. }
  690. // AppVersion: This represents a single version of the app.
  691. type AppVersion struct {
  692. // IsProduction: True if this version is a production APK.
  693. IsProduction bool `json:"isProduction,omitempty"`
  694. // Track: Deprecated, use trackId instead.
  695. Track string `json:"track,omitempty"`
  696. // TrackId: Track ids that the app version is published in. Replaces the
  697. // track field (deprecated), but doesn't include the production track
  698. // (see isProduction instead).
  699. TrackId []string `json:"trackId,omitempty"`
  700. // VersionCode: Unique increasing identifier for the app version.
  701. VersionCode int64 `json:"versionCode,omitempty"`
  702. // VersionString: The string used in the Play store by the app developer
  703. // to identify the version. The string is not necessarily unique or
  704. // localized (for example, the string could be "1.4").
  705. VersionString string `json:"versionString,omitempty"`
  706. // ForceSendFields is a list of field names (e.g. "IsProduction") to
  707. // unconditionally include in API requests. By default, fields with
  708. // empty values are omitted from API requests. However, any non-pointer,
  709. // non-interface field appearing in ForceSendFields will be sent to the
  710. // server regardless of whether the field is empty or not. This may be
  711. // used to include empty fields in Patch requests.
  712. ForceSendFields []string `json:"-"`
  713. // NullFields is a list of field names (e.g. "IsProduction") to include
  714. // in API requests with the JSON null value. By default, fields with
  715. // empty values are omitted from API requests. However, any field with
  716. // an empty value appearing in NullFields will be sent to the server as
  717. // null. It is an error if a field in this list has a non-empty value.
  718. // This may be used to include null fields in Patch requests.
  719. NullFields []string `json:"-"`
  720. }
  721. func (s *AppVersion) MarshalJSON() ([]byte, error) {
  722. type NoMethod AppVersion
  723. raw := NoMethod(*s)
  724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  725. }
  726. // ApprovalUrlInfo: Information on an approval URL.
  727. type ApprovalUrlInfo struct {
  728. // ApprovalUrl: A URL that displays a product's permissions and that can
  729. // also be used to approve the product with the Products.approve call.
  730. ApprovalUrl string `json:"approvalUrl,omitempty"`
  731. // Kind: Identifies what kind of resource this is. Value: the fixed
  732. // string "androidenterprise#approvalUrlInfo".
  733. Kind string `json:"kind,omitempty"`
  734. // ForceSendFields is a list of field names (e.g. "ApprovalUrl") to
  735. // unconditionally include in API requests. By default, fields with
  736. // empty values are omitted from API requests. However, any non-pointer,
  737. // non-interface field appearing in ForceSendFields will be sent to the
  738. // server regardless of whether the field is empty or not. This may be
  739. // used to include empty fields in Patch requests.
  740. ForceSendFields []string `json:"-"`
  741. // NullFields is a list of field names (e.g. "ApprovalUrl") to include
  742. // in API requests with the JSON null value. By default, fields with
  743. // empty values are omitted from API requests. However, any field with
  744. // an empty value appearing in NullFields will be sent to the server as
  745. // null. It is an error if a field in this list has a non-empty value.
  746. // This may be used to include null fields in Patch requests.
  747. NullFields []string `json:"-"`
  748. }
  749. func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) {
  750. type NoMethod ApprovalUrlInfo
  751. raw := NoMethod(*s)
  752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  753. }
  754. // AuthenticationToken: An AuthenticationToken is used by the EMM's
  755. // device policy client on a device to provision the given EMM-managed
  756. // user on that device.
  757. type AuthenticationToken struct {
  758. // Kind: Identifies what kind of resource this is. Value: the fixed
  759. // string "androidenterprise#authenticationToken".
  760. Kind string `json:"kind,omitempty"`
  761. // Token: The authentication token to be passed to the device policy
  762. // client on the device where it can be used to provision the account
  763. // for which this token was generated.
  764. Token string `json:"token,omitempty"`
  765. // ServerResponse contains the HTTP response code and headers from the
  766. // server.
  767. googleapi.ServerResponse `json:"-"`
  768. // ForceSendFields is a list of field names (e.g. "Kind") to
  769. // unconditionally include in API requests. By default, fields with
  770. // empty values are omitted from API requests. However, any non-pointer,
  771. // non-interface field appearing in ForceSendFields will be sent to the
  772. // server regardless of whether the field is empty or not. This may be
  773. // used to include empty fields in Patch requests.
  774. ForceSendFields []string `json:"-"`
  775. // NullFields is a list of field names (e.g. "Kind") to include in API
  776. // requests with the JSON null value. By default, fields with empty
  777. // values are omitted from API requests. However, any field with an
  778. // empty value appearing in NullFields will be sent to the server as
  779. // null. It is an error if a field in this list has a non-empty value.
  780. // This may be used to include null fields in Patch requests.
  781. NullFields []string `json:"-"`
  782. }
  783. func (s *AuthenticationToken) MarshalJSON() ([]byte, error) {
  784. type NoMethod AuthenticationToken
  785. raw := NoMethod(*s)
  786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  787. }
  788. // AutoInstallConstraint: The auto-install constraint. Defines a set of
  789. // restrictions for installation. At least one of the fields must be
  790. // set.
  791. type AutoInstallConstraint struct {
  792. // ChargingStateConstraint: Charging state constraint.
  793. ChargingStateConstraint string `json:"chargingStateConstraint,omitempty"`
  794. // DeviceIdleStateConstraint: Device idle state constraint.
  795. DeviceIdleStateConstraint string `json:"deviceIdleStateConstraint,omitempty"`
  796. // NetworkTypeConstraint: Network type constraint.
  797. NetworkTypeConstraint string `json:"networkTypeConstraint,omitempty"`
  798. // ForceSendFields is a list of field names (e.g.
  799. // "ChargingStateConstraint") to unconditionally include in API
  800. // requests. By default, fields with empty values are omitted from API
  801. // requests. However, any non-pointer, non-interface field appearing in
  802. // ForceSendFields will be sent to the server regardless of whether the
  803. // field is empty or not. This may be used to include empty fields in
  804. // Patch requests.
  805. ForceSendFields []string `json:"-"`
  806. // NullFields is a list of field names (e.g. "ChargingStateConstraint")
  807. // to include in API requests with the JSON null value. By default,
  808. // fields with empty values are omitted from API requests. However, any
  809. // field with an empty value appearing in NullFields will be sent to the
  810. // server as null. It is an error if a field in this list has a
  811. // non-empty value. This may be used to include null fields in Patch
  812. // requests.
  813. NullFields []string `json:"-"`
  814. }
  815. func (s *AutoInstallConstraint) MarshalJSON() ([]byte, error) {
  816. type NoMethod AutoInstallConstraint
  817. raw := NoMethod(*s)
  818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  819. }
  820. type AutoInstallPolicy struct {
  821. // AutoInstallConstraint: The constraints for auto-installing the app.
  822. // You can specify a maximum of one constraint.
  823. AutoInstallConstraint []*AutoInstallConstraint `json:"autoInstallConstraint,omitempty"`
  824. // AutoInstallMode: The auto-install mode. If unset defaults to
  825. // "doNotAutoInstall".
  826. AutoInstallMode string `json:"autoInstallMode,omitempty"`
  827. // AutoInstallPriority: The priority of the install, as an unsigned
  828. // integer. A lower number means higher priority.
  829. AutoInstallPriority int64 `json:"autoInstallPriority,omitempty"`
  830. // MinimumVersionCode: The minimum version of the app. If a lower
  831. // version of the app is installed, then the app will be auto-updated
  832. // according to the auto-install constraints, instead of waiting for the
  833. // regular auto-update.
  834. MinimumVersionCode int64 `json:"minimumVersionCode,omitempty"`
  835. // ForceSendFields is a list of field names (e.g.
  836. // "AutoInstallConstraint") to unconditionally include in API requests.
  837. // By default, fields with empty values are omitted from API requests.
  838. // However, any non-pointer, non-interface field appearing in
  839. // ForceSendFields will be sent to the server regardless of whether the
  840. // field is empty or not. This may be used to include empty fields in
  841. // Patch requests.
  842. ForceSendFields []string `json:"-"`
  843. // NullFields is a list of field names (e.g. "AutoInstallConstraint") to
  844. // include in API requests with the JSON null value. By default, fields
  845. // with empty values are omitted from API requests. However, any field
  846. // with an empty value appearing in NullFields will be sent to the
  847. // server as null. It is an error if a field in this list has a
  848. // non-empty value. This may be used to include null fields in Patch
  849. // requests.
  850. NullFields []string `json:"-"`
  851. }
  852. func (s *AutoInstallPolicy) MarshalJSON() ([]byte, error) {
  853. type NoMethod AutoInstallPolicy
  854. raw := NoMethod(*s)
  855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  856. }
  857. // ConfigurationVariables: A configuration variables resource contains
  858. // the managed configuration settings ID to be applied to a single user,
  859. // as well as the variable set that is attributed to the user. The
  860. // variable set will be used to replace placeholders in the managed
  861. // configuration settings.
  862. type ConfigurationVariables struct {
  863. // Kind: Identifies what kind of resource this is. Value: the fixed
  864. // string "androidenterprise#configurationVariables".
  865. Kind string `json:"kind,omitempty"`
  866. // McmId: The ID of the managed configurations settings.
  867. McmId string `json:"mcmId,omitempty"`
  868. // VariableSet: The variable set that is attributed to the user.
  869. VariableSet []*VariableSet `json:"variableSet,omitempty"`
  870. // ForceSendFields is a list of field names (e.g. "Kind") to
  871. // unconditionally include in API requests. By default, fields with
  872. // empty values are omitted from API requests. However, any non-pointer,
  873. // non-interface field appearing in ForceSendFields will be sent to the
  874. // server regardless of whether the field is empty or not. This may be
  875. // used to include empty fields in Patch requests.
  876. ForceSendFields []string `json:"-"`
  877. // NullFields is a list of field names (e.g. "Kind") to include in API
  878. // requests with the JSON null value. By default, fields with empty
  879. // values are omitted from API requests. However, any field with an
  880. // empty value appearing in NullFields will be sent to the server as
  881. // null. It is an error if a field in this list has a non-empty value.
  882. // This may be used to include null fields in Patch requests.
  883. NullFields []string `json:"-"`
  884. }
  885. func (s *ConfigurationVariables) MarshalJSON() ([]byte, error) {
  886. type NoMethod ConfigurationVariables
  887. raw := NoMethod(*s)
  888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  889. }
  890. // Device: A Devices resource represents a mobile device managed by the
  891. // EMM and belonging to a specific enterprise user.
  892. type Device struct {
  893. // AndroidId: The Google Play Services Android ID for the device encoded
  894. // as a lowercase hex string. For example, "123456789abcdef0".
  895. AndroidId string `json:"androidId,omitempty"`
  896. // Kind: Identifies what kind of resource this is. Value: the fixed
  897. // string "androidenterprise#device".
  898. Kind string `json:"kind,omitempty"`
  899. // ManagementType: Identifies the extent to which the device is
  900. // controlled by a managed Google Play EMM in various deployment
  901. // configurations.
  902. //
  903. // Possible values include:
  904. // - "managedDevice", a device that has the EMM's device policy
  905. // controller (DPC) as the device owner.
  906. // - "managedProfile", a device that has a profile managed by the DPC
  907. // (DPC is profile owner) in addition to a separate, personal profile
  908. // that is unavailable to the DPC.
  909. // - "containerApp", no longer used (deprecated).
  910. // - "unmanagedProfile", a device that has been allowed (by the domain's
  911. // admin, using the Admin Console to enable the privilege) to use
  912. // managed Google Play, but the profile is itself not owned by a DPC.
  913. ManagementType string `json:"managementType,omitempty"`
  914. // Policy: The policy enforced on the device.
  915. Policy *Policy `json:"policy,omitempty"`
  916. // ServerResponse contains the HTTP response code and headers from the
  917. // server.
  918. googleapi.ServerResponse `json:"-"`
  919. // ForceSendFields is a list of field names (e.g. "AndroidId") to
  920. // unconditionally include in API requests. By default, fields with
  921. // empty values are omitted from API requests. However, any non-pointer,
  922. // non-interface field appearing in ForceSendFields will be sent to the
  923. // server regardless of whether the field is empty or not. This may be
  924. // used to include empty fields in Patch requests.
  925. ForceSendFields []string `json:"-"`
  926. // NullFields is a list of field names (e.g. "AndroidId") to include in
  927. // API requests with the JSON null value. By default, fields with empty
  928. // values are omitted from API requests. However, any field with an
  929. // empty value appearing in NullFields will be sent to the server as
  930. // null. It is an error if a field in this list has a non-empty value.
  931. // This may be used to include null fields in Patch requests.
  932. NullFields []string `json:"-"`
  933. }
  934. func (s *Device) MarshalJSON() ([]byte, error) {
  935. type NoMethod Device
  936. raw := NoMethod(*s)
  937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  938. }
  939. // DeviceState: The state of a user's device, as accessed by the
  940. // getState and setState methods on device resources.
  941. type DeviceState struct {
  942. // AccountState: The state of the Google account on the device.
  943. // "enabled" indicates that the Google account on the device can be used
  944. // to access Google services (including Google Play), while "disabled"
  945. // means that it cannot. A new device is initially in the "disabled"
  946. // state.
  947. AccountState string `json:"accountState,omitempty"`
  948. // Kind: Identifies what kind of resource this is. Value: the fixed
  949. // string "androidenterprise#deviceState".
  950. Kind string `json:"kind,omitempty"`
  951. // ServerResponse contains the HTTP response code and headers from the
  952. // server.
  953. googleapi.ServerResponse `json:"-"`
  954. // ForceSendFields is a list of field names (e.g. "AccountState") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "AccountState") to include
  962. // in API requests with the JSON null value. By default, fields with
  963. // empty values are omitted from API requests. However, any field with
  964. // an empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *DeviceState) MarshalJSON() ([]byte, error) {
  970. type NoMethod DeviceState
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // DevicesListResponse: The device resources for the user.
  975. type DevicesListResponse struct {
  976. // Device: A managed device.
  977. Device []*Device `json:"device,omitempty"`
  978. // Kind: Identifies what kind of resource this is. Value: the fixed
  979. // string "androidenterprise#devicesListResponse".
  980. Kind string `json:"kind,omitempty"`
  981. // ServerResponse contains the HTTP response code and headers from the
  982. // server.
  983. googleapi.ServerResponse `json:"-"`
  984. // ForceSendFields is a list of field names (e.g. "Device") to
  985. // unconditionally include in API requests. By default, fields with
  986. // empty values are omitted from API requests. However, any non-pointer,
  987. // non-interface field appearing in ForceSendFields will be sent to the
  988. // server regardless of whether the field is empty or not. This may be
  989. // used to include empty fields in Patch requests.
  990. ForceSendFields []string `json:"-"`
  991. // NullFields is a list of field names (e.g. "Device") to include in API
  992. // requests with the JSON null value. By default, fields with empty
  993. // values are omitted from API requests. However, any field with an
  994. // empty value appearing in NullFields will be sent to the server as
  995. // null. It is an error if a field in this list has a non-empty value.
  996. // This may be used to include null fields in Patch requests.
  997. NullFields []string `json:"-"`
  998. }
  999. func (s *DevicesListResponse) MarshalJSON() ([]byte, error) {
  1000. type NoMethod DevicesListResponse
  1001. raw := NoMethod(*s)
  1002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1003. }
  1004. // Enterprise: An Enterprises resource represents the binding between an
  1005. // EMM and a specific organization. That binding can be instantiated in
  1006. // one of two different ways using this API as follows:
  1007. // - For Google managed domain customers, the process involves using
  1008. // Enterprises.enroll and Enterprises.setAccount (in conjunction with
  1009. // artifacts obtained from the Admin console and the Google API Console)
  1010. // and submitted to the EMM through a more-or-less manual process.
  1011. // - For managed Google Play Accounts customers, the process involves
  1012. // using Enterprises.generateSignupUrl and Enterprises.completeSignup in
  1013. // conjunction with the managed Google Play sign-up UI (Google-provided
  1014. // mechanism) to create the binding without manual steps. As an EMM, you
  1015. // can support either or both approaches in your EMM console. See Create
  1016. // an Enterprise for details.
  1017. type Enterprise struct {
  1018. // Administrator: Admins of the enterprise. This is only supported for
  1019. // enterprises created via the EMM-initiated flow.
  1020. Administrator []*Administrator `json:"administrator,omitempty"`
  1021. // Id: The unique ID for the enterprise.
  1022. Id string `json:"id,omitempty"`
  1023. // Kind: Identifies what kind of resource this is. Value: the fixed
  1024. // string "androidenterprise#enterprise".
  1025. Kind string `json:"kind,omitempty"`
  1026. // Name: The name of the enterprise, for example, "Example, Inc".
  1027. Name string `json:"name,omitempty"`
  1028. // PrimaryDomain: The enterprise's primary domain, such as
  1029. // "example.com".
  1030. PrimaryDomain string `json:"primaryDomain,omitempty"`
  1031. // ServerResponse contains the HTTP response code and headers from the
  1032. // server.
  1033. googleapi.ServerResponse `json:"-"`
  1034. // ForceSendFields is a list of field names (e.g. "Administrator") to
  1035. // unconditionally include in API requests. By default, fields with
  1036. // empty values are omitted from API requests. However, any non-pointer,
  1037. // non-interface field appearing in ForceSendFields will be sent to the
  1038. // server regardless of whether the field is empty or not. This may be
  1039. // used to include empty fields in Patch requests.
  1040. ForceSendFields []string `json:"-"`
  1041. // NullFields is a list of field names (e.g. "Administrator") to include
  1042. // in API requests with the JSON null value. By default, fields with
  1043. // empty values are omitted from API requests. However, any field with
  1044. // an empty value appearing in NullFields will be sent to the server as
  1045. // null. It is an error if a field in this list has a non-empty value.
  1046. // This may be used to include null fields in Patch requests.
  1047. NullFields []string `json:"-"`
  1048. }
  1049. func (s *Enterprise) MarshalJSON() ([]byte, error) {
  1050. type NoMethod Enterprise
  1051. raw := NoMethod(*s)
  1052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1053. }
  1054. // EnterpriseAccount: A service account that can be used to authenticate
  1055. // as the enterprise to API calls that require such authentication.
  1056. type EnterpriseAccount struct {
  1057. // AccountEmail: The email address of the service account.
  1058. AccountEmail string `json:"accountEmail,omitempty"`
  1059. // Kind: Identifies what kind of resource this is. Value: the fixed
  1060. // string "androidenterprise#enterpriseAccount".
  1061. Kind string `json:"kind,omitempty"`
  1062. // ServerResponse contains the HTTP response code and headers from the
  1063. // server.
  1064. googleapi.ServerResponse `json:"-"`
  1065. // ForceSendFields is a list of field names (e.g. "AccountEmail") to
  1066. // unconditionally include in API requests. By default, fields with
  1067. // empty values are omitted from API requests. However, any non-pointer,
  1068. // non-interface field appearing in ForceSendFields will be sent to the
  1069. // server regardless of whether the field is empty or not. This may be
  1070. // used to include empty fields in Patch requests.
  1071. ForceSendFields []string `json:"-"`
  1072. // NullFields is a list of field names (e.g. "AccountEmail") to include
  1073. // in API requests with the JSON null value. By default, fields with
  1074. // empty values are omitted from API requests. However, any field with
  1075. // an empty value appearing in NullFields will be sent to the server as
  1076. // null. It is an error if a field in this list has a non-empty value.
  1077. // This may be used to include null fields in Patch requests.
  1078. NullFields []string `json:"-"`
  1079. }
  1080. func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) {
  1081. type NoMethod EnterpriseAccount
  1082. raw := NoMethod(*s)
  1083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1084. }
  1085. // EnterprisesListResponse: The matching enterprise resources.
  1086. type EnterprisesListResponse struct {
  1087. // Enterprise: An enterprise.
  1088. Enterprise []*Enterprise `json:"enterprise,omitempty"`
  1089. // Kind: Identifies what kind of resource this is. Value: the fixed
  1090. // string "androidenterprise#enterprisesListResponse".
  1091. Kind string `json:"kind,omitempty"`
  1092. // ServerResponse contains the HTTP response code and headers from the
  1093. // server.
  1094. googleapi.ServerResponse `json:"-"`
  1095. // ForceSendFields is a list of field names (e.g. "Enterprise") to
  1096. // unconditionally include in API requests. By default, fields with
  1097. // empty values are omitted from API requests. However, any non-pointer,
  1098. // non-interface field appearing in ForceSendFields will be sent to the
  1099. // server regardless of whether the field is empty or not. This may be
  1100. // used to include empty fields in Patch requests.
  1101. ForceSendFields []string `json:"-"`
  1102. // NullFields is a list of field names (e.g. "Enterprise") to include in
  1103. // API requests with the JSON null value. By default, fields with empty
  1104. // values are omitted from API requests. However, any field with an
  1105. // empty value appearing in NullFields will be sent to the server as
  1106. // null. It is an error if a field in this list has a non-empty value.
  1107. // This may be used to include null fields in Patch requests.
  1108. NullFields []string `json:"-"`
  1109. }
  1110. func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) {
  1111. type NoMethod EnterprisesListResponse
  1112. raw := NoMethod(*s)
  1113. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1114. }
  1115. type EnterprisesSendTestPushNotificationResponse struct {
  1116. // MessageId: The message ID of the test push notification that was
  1117. // sent.
  1118. MessageId string `json:"messageId,omitempty"`
  1119. // TopicName: The name of the Cloud Pub/Sub topic to which notifications
  1120. // for this enterprise's enrolled account will be sent.
  1121. TopicName string `json:"topicName,omitempty"`
  1122. // ServerResponse contains the HTTP response code and headers from the
  1123. // server.
  1124. googleapi.ServerResponse `json:"-"`
  1125. // ForceSendFields is a list of field names (e.g. "MessageId") to
  1126. // unconditionally include in API requests. By default, fields with
  1127. // empty values are omitted from API requests. However, any non-pointer,
  1128. // non-interface field appearing in ForceSendFields will be sent to the
  1129. // server regardless of whether the field is empty or not. This may be
  1130. // used to include empty fields in Patch requests.
  1131. ForceSendFields []string `json:"-"`
  1132. // NullFields is a list of field names (e.g. "MessageId") to include in
  1133. // API requests with the JSON null value. By default, fields with empty
  1134. // values are omitted from API requests. However, any field with an
  1135. // empty value appearing in NullFields will be sent to the server as
  1136. // null. It is an error if a field in this list has a non-empty value.
  1137. // This may be used to include null fields in Patch requests.
  1138. NullFields []string `json:"-"`
  1139. }
  1140. func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) {
  1141. type NoMethod EnterprisesSendTestPushNotificationResponse
  1142. raw := NoMethod(*s)
  1143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1144. }
  1145. // Entitlement: The presence of an Entitlements resource indicates that
  1146. // a user has the right to use a particular app. Entitlements are user
  1147. // specific, not device specific. This allows a user with an entitlement
  1148. // to an app to install the app on all their devices. It's also possible
  1149. // for a user to hold an entitlement to an app without installing the
  1150. // app on any device.
  1151. //
  1152. // The API can be used to create an entitlement. As an option, you can
  1153. // also use the API to trigger the installation of an app on all a
  1154. // user's managed devices at the same time the entitlement is
  1155. // created.
  1156. //
  1157. // If the app is free, creating the entitlement also creates a group
  1158. // license for that app. For paid apps, creating the entitlement
  1159. // consumes one license, and that license remains consumed until the
  1160. // entitlement is removed. If the enterprise hasn't purchased enough
  1161. // licenses, then no entitlement is created and the installation fails.
  1162. // An entitlement is also not created for an app if the app requires
  1163. // permissions that the enterprise hasn't accepted.
  1164. //
  1165. // If an entitlement is deleted, the app may be uninstalled from a
  1166. // user's device. As a best practice, uninstall the app by calling
  1167. // Installs.delete() before deleting the entitlement.
  1168. //
  1169. // Entitlements for apps that a user pays for on an unmanaged profile
  1170. // have "userPurchase" as the entitlement reason. These entitlements
  1171. // cannot be removed via the API.
  1172. type Entitlement struct {
  1173. // Kind: Identifies what kind of resource this is. Value: the fixed
  1174. // string "androidenterprise#entitlement".
  1175. Kind string `json:"kind,omitempty"`
  1176. // ProductId: The ID of the product that the entitlement is for. For
  1177. // example, "app:com.google.android.gm".
  1178. ProductId string `json:"productId,omitempty"`
  1179. // Reason: The reason for the entitlement. For example, "free" for free
  1180. // apps. This property is temporary: it will be replaced by the
  1181. // acquisition kind field of group licenses.
  1182. Reason string `json:"reason,omitempty"`
  1183. // ServerResponse contains the HTTP response code and headers from the
  1184. // server.
  1185. googleapi.ServerResponse `json:"-"`
  1186. // ForceSendFields is a list of field names (e.g. "Kind") to
  1187. // unconditionally include in API requests. By default, fields with
  1188. // empty values are omitted from API requests. However, any non-pointer,
  1189. // non-interface field appearing in ForceSendFields will be sent to the
  1190. // server regardless of whether the field is empty or not. This may be
  1191. // used to include empty fields in Patch requests.
  1192. ForceSendFields []string `json:"-"`
  1193. // NullFields is a list of field names (e.g. "Kind") to include in API
  1194. // requests with the JSON null value. By default, fields with empty
  1195. // values are omitted from API requests. However, any field with an
  1196. // empty value appearing in NullFields will be sent to the server as
  1197. // null. It is an error if a field in this list has a non-empty value.
  1198. // This may be used to include null fields in Patch requests.
  1199. NullFields []string `json:"-"`
  1200. }
  1201. func (s *Entitlement) MarshalJSON() ([]byte, error) {
  1202. type NoMethod Entitlement
  1203. raw := NoMethod(*s)
  1204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1205. }
  1206. // EntitlementsListResponse: The entitlement resources for the user.
  1207. type EntitlementsListResponse struct {
  1208. // Entitlement: An entitlement of a user to a product (e.g. an app). For
  1209. // example, a free app that they have installed, or a paid app that they
  1210. // have been allocated a license to.
  1211. Entitlement []*Entitlement `json:"entitlement,omitempty"`
  1212. // Kind: Identifies what kind of resource this is. Value: the fixed
  1213. // string "androidenterprise#entitlementsListResponse".
  1214. Kind string `json:"kind,omitempty"`
  1215. // ServerResponse contains the HTTP response code and headers from the
  1216. // server.
  1217. googleapi.ServerResponse `json:"-"`
  1218. // ForceSendFields is a list of field names (e.g. "Entitlement") to
  1219. // unconditionally include in API requests. By default, fields with
  1220. // empty values are omitted from API requests. However, any non-pointer,
  1221. // non-interface field appearing in ForceSendFields will be sent to the
  1222. // server regardless of whether the field is empty or not. This may be
  1223. // used to include empty fields in Patch requests.
  1224. ForceSendFields []string `json:"-"`
  1225. // NullFields is a list of field names (e.g. "Entitlement") to include
  1226. // in API requests with the JSON null value. By default, fields with
  1227. // empty values are omitted from API requests. However, any field with
  1228. // an empty value appearing in NullFields will be sent to the server as
  1229. // null. It is an error if a field in this list has a non-empty value.
  1230. // This may be used to include null fields in Patch requests.
  1231. NullFields []string `json:"-"`
  1232. }
  1233. func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) {
  1234. type NoMethod EntitlementsListResponse
  1235. raw := NoMethod(*s)
  1236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1237. }
  1238. // GroupLicense: Group license objects allow you to keep track of
  1239. // licenses (called entitlements) for both free and paid apps. For a
  1240. // free app, a group license is created when an enterprise admin first
  1241. // approves the product in Google Play or when the first entitlement for
  1242. // the product is created for a user via the API. For a paid app, a
  1243. // group license object is only created when an enterprise admin
  1244. // purchases the product in Google Play for the first time.
  1245. //
  1246. // Use the API to query group licenses. A Grouplicenses resource
  1247. // includes the total number of licenses purchased (paid apps only) and
  1248. // the total number of licenses currently in use. In other words, the
  1249. // total number of Entitlements that exist for the product.
  1250. //
  1251. // Only one group license object is created per product and group
  1252. // license objects are never deleted. If a product is unapproved, its
  1253. // group license remains. This allows enterprise admins to keep track of
  1254. // any remaining entitlements for the product.
  1255. type GroupLicense struct {
  1256. // AcquisitionKind: How this group license was acquired. "bulkPurchase"
  1257. // means that this Grouplicenses resource was created because the
  1258. // enterprise purchased licenses for this product; otherwise, the value
  1259. // is "free" (for free products).
  1260. AcquisitionKind string `json:"acquisitionKind,omitempty"`
  1261. // Approval: Whether the product to which this group license relates is
  1262. // currently approved by the enterprise. Products are approved when a
  1263. // group license is first created, but this approval may be revoked by
  1264. // an enterprise admin via Google Play. Unapproved products will not be
  1265. // visible to end users in collections, and new entitlements to them
  1266. // should not normally be created.
  1267. Approval string `json:"approval,omitempty"`
  1268. // Kind: Identifies what kind of resource this is. Value: the fixed
  1269. // string "androidenterprise#groupLicense".
  1270. Kind string `json:"kind,omitempty"`
  1271. // NumProvisioned: The total number of provisioned licenses for this
  1272. // product. Returned by read operations, but ignored in write
  1273. // operations.
  1274. NumProvisioned int64 `json:"numProvisioned,omitempty"`
  1275. // NumPurchased: The number of purchased licenses (possibly in multiple
  1276. // purchases). If this field is omitted, then there is no limit on the
  1277. // number of licenses that can be provisioned (for example, if the
  1278. // acquisition kind is "free").
  1279. NumPurchased int64 `json:"numPurchased,omitempty"`
  1280. // Permissions: The permission approval status of the product. This
  1281. // field is only set if the product is approved. Possible states are:
  1282. // - "currentApproved", the current set of permissions is approved, but
  1283. // additional permissions will require the administrator to reapprove
  1284. // the product (If the product was approved without specifying the
  1285. // approved permissions setting, then this is the default behavior.),
  1286. // - "needsReapproval", the product has unapproved permissions. No
  1287. // additional product licenses can be assigned until the product is
  1288. // reapproved,
  1289. // - "allCurrentAndFutureApproved", the current permissions are approved
  1290. // and any future permission updates will be automatically approved
  1291. // without administrator review.
  1292. Permissions string `json:"permissions,omitempty"`
  1293. // ProductId: The ID of the product that the license is for. For
  1294. // example, "app:com.google.android.gm".
  1295. ProductId string `json:"productId,omitempty"`
  1296. // ServerResponse contains the HTTP response code and headers from the
  1297. // server.
  1298. googleapi.ServerResponse `json:"-"`
  1299. // ForceSendFields is a list of field names (e.g. "AcquisitionKind") to
  1300. // unconditionally include in API requests. By default, fields with
  1301. // empty values are omitted from API requests. However, any non-pointer,
  1302. // non-interface field appearing in ForceSendFields will be sent to the
  1303. // server regardless of whether the field is empty or not. This may be
  1304. // used to include empty fields in Patch requests.
  1305. ForceSendFields []string `json:"-"`
  1306. // NullFields is a list of field names (e.g. "AcquisitionKind") to
  1307. // include in API requests with the JSON null value. By default, fields
  1308. // with empty values are omitted from API requests. However, any field
  1309. // with an empty value appearing in NullFields will be sent to the
  1310. // server as null. It is an error if a field in this list has a
  1311. // non-empty value. This may be used to include null fields in Patch
  1312. // requests.
  1313. NullFields []string `json:"-"`
  1314. }
  1315. func (s *GroupLicense) MarshalJSON() ([]byte, error) {
  1316. type NoMethod GroupLicense
  1317. raw := NoMethod(*s)
  1318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1319. }
  1320. // GroupLicenseUsersListResponse: The user resources for the group
  1321. // license.
  1322. type GroupLicenseUsersListResponse struct {
  1323. // Kind: Identifies what kind of resource this is. Value: the fixed
  1324. // string "androidenterprise#groupLicenseUsersListResponse".
  1325. Kind string `json:"kind,omitempty"`
  1326. // User: A user of an enterprise.
  1327. User []*User `json:"user,omitempty"`
  1328. // ServerResponse contains the HTTP response code and headers from the
  1329. // server.
  1330. googleapi.ServerResponse `json:"-"`
  1331. // ForceSendFields is a list of field names (e.g. "Kind") to
  1332. // unconditionally include in API requests. By default, fields with
  1333. // empty values are omitted from API requests. However, any non-pointer,
  1334. // non-interface field appearing in ForceSendFields will be sent to the
  1335. // server regardless of whether the field is empty or not. This may be
  1336. // used to include empty fields in Patch requests.
  1337. ForceSendFields []string `json:"-"`
  1338. // NullFields is a list of field names (e.g. "Kind") to include in API
  1339. // requests with the JSON null value. By default, fields with empty
  1340. // values are omitted from API requests. However, any field with an
  1341. // empty value appearing in NullFields will be sent to the server as
  1342. // null. It is an error if a field in this list has a non-empty value.
  1343. // This may be used to include null fields in Patch requests.
  1344. NullFields []string `json:"-"`
  1345. }
  1346. func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) {
  1347. type NoMethod GroupLicenseUsersListResponse
  1348. raw := NoMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1350. }
  1351. // GroupLicensesListResponse: The grouplicense resources for the
  1352. // enterprise.
  1353. type GroupLicensesListResponse struct {
  1354. // GroupLicense: A group license for a product approved for use in the
  1355. // enterprise.
  1356. GroupLicense []*GroupLicense `json:"groupLicense,omitempty"`
  1357. // Kind: Identifies what kind of resource this is. Value: the fixed
  1358. // string "androidenterprise#groupLicensesListResponse".
  1359. Kind string `json:"kind,omitempty"`
  1360. // ServerResponse contains the HTTP response code and headers from the
  1361. // server.
  1362. googleapi.ServerResponse `json:"-"`
  1363. // ForceSendFields is a list of field names (e.g. "GroupLicense") to
  1364. // unconditionally include in API requests. By default, fields with
  1365. // empty values are omitted from API requests. However, any non-pointer,
  1366. // non-interface field appearing in ForceSendFields will be sent to the
  1367. // server regardless of whether the field is empty or not. This may be
  1368. // used to include empty fields in Patch requests.
  1369. ForceSendFields []string `json:"-"`
  1370. // NullFields is a list of field names (e.g. "GroupLicense") to include
  1371. // in API requests with the JSON null value. By default, fields with
  1372. // empty values are omitted from API requests. However, any field with
  1373. // an empty value appearing in NullFields will be sent to the server as
  1374. // null. It is an error if a field in this list has a non-empty value.
  1375. // This may be used to include null fields in Patch requests.
  1376. NullFields []string `json:"-"`
  1377. }
  1378. func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) {
  1379. type NoMethod GroupLicensesListResponse
  1380. raw := NoMethod(*s)
  1381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1382. }
  1383. // Install: The existence of an Installs resource indicates that an app
  1384. // is installed on a particular device (or that an install is
  1385. // pending).
  1386. //
  1387. // The API can be used to create an install resource using the update
  1388. // method. This triggers the actual install of the app on the device. If
  1389. // the user does not already have an entitlement for the app, then an
  1390. // attempt is made to create one. If this fails (for example, because
  1391. // the app is not free and there is no available license), then the
  1392. // creation of the install fails.
  1393. //
  1394. // The API can also be used to update an installed app. If
  1395. // the update method is used on an existing install, then the app will
  1396. // be updated to the latest available version.
  1397. //
  1398. // Note that it is not possible to force the installation of a specific
  1399. // version of an app: the version code is read-only.
  1400. //
  1401. // If a user installs an app themselves (as permitted by the
  1402. // enterprise), then again an install resource and possibly an
  1403. // entitlement resource are automatically created.
  1404. //
  1405. // The API can also be used to delete an install resource, which
  1406. // triggers the removal of the app from the device. Note that deleting
  1407. // an install does not automatically remove the corresponding
  1408. // entitlement, even if there are no remaining installs. The install
  1409. // resource will also be deleted if the user uninstalls the app
  1410. // themselves.
  1411. type Install struct {
  1412. // InstallState: Install state. The state "installPending" means that an
  1413. // install request has recently been made and download to the device is
  1414. // in progress. The state "installed" means that the app has been
  1415. // installed. This field is read-only.
  1416. InstallState string `json:"installState,omitempty"`
  1417. // Kind: Identifies what kind of resource this is. Value: the fixed
  1418. // string "androidenterprise#install".
  1419. Kind string `json:"kind,omitempty"`
  1420. // ProductId: The ID of the product that the install is for. For
  1421. // example, "app:com.google.android.gm".
  1422. ProductId string `json:"productId,omitempty"`
  1423. // VersionCode: The version of the installed product. Guaranteed to be
  1424. // set only if the install state is "installed".
  1425. VersionCode int64 `json:"versionCode,omitempty"`
  1426. // ServerResponse contains the HTTP response code and headers from the
  1427. // server.
  1428. googleapi.ServerResponse `json:"-"`
  1429. // ForceSendFields is a list of field names (e.g. "InstallState") to
  1430. // unconditionally include in API requests. By default, fields with
  1431. // empty values are omitted from API requests. However, any non-pointer,
  1432. // non-interface field appearing in ForceSendFields will be sent to the
  1433. // server regardless of whether the field is empty or not. This may be
  1434. // used to include empty fields in Patch requests.
  1435. ForceSendFields []string `json:"-"`
  1436. // NullFields is a list of field names (e.g. "InstallState") to include
  1437. // in API requests with the JSON null value. By default, fields with
  1438. // empty values are omitted from API requests. However, any field with
  1439. // an empty value appearing in NullFields will be sent to the server as
  1440. // null. It is an error if a field in this list has a non-empty value.
  1441. // This may be used to include null fields in Patch requests.
  1442. NullFields []string `json:"-"`
  1443. }
  1444. func (s *Install) MarshalJSON() ([]byte, error) {
  1445. type NoMethod Install
  1446. raw := NoMethod(*s)
  1447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1448. }
  1449. // InstallFailureEvent: An event generated when an app installation
  1450. // failed on a device
  1451. type InstallFailureEvent struct {
  1452. // DeviceId: The Android ID of the device. This field will always be
  1453. // present.
  1454. DeviceId string `json:"deviceId,omitempty"`
  1455. // FailureDetails: Additional details on the failure if applicable.
  1456. FailureDetails string `json:"failureDetails,omitempty"`
  1457. // FailureReason: The reason for the installation failure. This field
  1458. // will always be present.
  1459. FailureReason string `json:"failureReason,omitempty"`
  1460. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  1461. // for which the install failure event occured. This field will always
  1462. // be present.
  1463. ProductId string `json:"productId,omitempty"`
  1464. // UserId: The ID of the user. This field will always be present.
  1465. UserId string `json:"userId,omitempty"`
  1466. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1467. // unconditionally include in API requests. By default, fields with
  1468. // empty values are omitted from API requests. However, any non-pointer,
  1469. // non-interface field appearing in ForceSendFields will be sent to the
  1470. // server regardless of whether the field is empty or not. This may be
  1471. // used to include empty fields in Patch requests.
  1472. ForceSendFields []string `json:"-"`
  1473. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1474. // API requests with the JSON null value. By default, fields with empty
  1475. // values are omitted from API requests. However, any field with an
  1476. // empty value appearing in NullFields will be sent to the server as
  1477. // null. It is an error if a field in this list has a non-empty value.
  1478. // This may be used to include null fields in Patch requests.
  1479. NullFields []string `json:"-"`
  1480. }
  1481. func (s *InstallFailureEvent) MarshalJSON() ([]byte, error) {
  1482. type NoMethod InstallFailureEvent
  1483. raw := NoMethod(*s)
  1484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1485. }
  1486. // InstallsListResponse: The install resources for the device.
  1487. type InstallsListResponse struct {
  1488. // Install: An installation of an app for a user on a specific device.
  1489. // The existence of an install implies that the user must have an
  1490. // entitlement to the app.
  1491. Install []*Install `json:"install,omitempty"`
  1492. // Kind: Identifies what kind of resource this is. Value: the fixed
  1493. // string "androidenterprise#installsListResponse".
  1494. Kind string `json:"kind,omitempty"`
  1495. // ServerResponse contains the HTTP response code and headers from the
  1496. // server.
  1497. googleapi.ServerResponse `json:"-"`
  1498. // ForceSendFields is a list of field names (e.g. "Install") to
  1499. // unconditionally include in API requests. By default, fields with
  1500. // empty values are omitted from API requests. However, any non-pointer,
  1501. // non-interface field appearing in ForceSendFields will be sent to the
  1502. // server regardless of whether the field is empty or not. This may be
  1503. // used to include empty fields in Patch requests.
  1504. ForceSendFields []string `json:"-"`
  1505. // NullFields is a list of field names (e.g. "Install") to include in
  1506. // API requests with the JSON null value. By default, fields with empty
  1507. // values are omitted from API requests. However, any field with an
  1508. // empty value appearing in NullFields will be sent to the server as
  1509. // null. It is an error if a field in this list has a non-empty value.
  1510. // This may be used to include null fields in Patch requests.
  1511. NullFields []string `json:"-"`
  1512. }
  1513. func (s *InstallsListResponse) MarshalJSON() ([]byte, error) {
  1514. type NoMethod InstallsListResponse
  1515. raw := NoMethod(*s)
  1516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1517. }
  1518. // LocalizedText: A localized string with its locale.
  1519. type LocalizedText struct {
  1520. // Locale: The BCP47 tag for a locale. (e.g. "en-US", "de").
  1521. Locale string `json:"locale,omitempty"`
  1522. // Text: The text localized in the associated locale.
  1523. Text string `json:"text,omitempty"`
  1524. // ForceSendFields is a list of field names (e.g. "Locale") to
  1525. // unconditionally include in API requests. By default, fields with
  1526. // empty values are omitted from API requests. However, any non-pointer,
  1527. // non-interface field appearing in ForceSendFields will be sent to the
  1528. // server regardless of whether the field is empty or not. This may be
  1529. // used to include empty fields in Patch requests.
  1530. ForceSendFields []string `json:"-"`
  1531. // NullFields is a list of field names (e.g. "Locale") to include in API
  1532. // requests with the JSON null value. By default, fields with empty
  1533. // values are omitted from API requests. However, any field with an
  1534. // empty value appearing in NullFields will be sent to the server as
  1535. // null. It is an error if a field in this list has a non-empty value.
  1536. // This may be used to include null fields in Patch requests.
  1537. NullFields []string `json:"-"`
  1538. }
  1539. func (s *LocalizedText) MarshalJSON() ([]byte, error) {
  1540. type NoMethod LocalizedText
  1541. raw := NoMethod(*s)
  1542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1543. }
  1544. // MaintenanceWindow: Maintenance window for managed Google Play
  1545. // Accounts. This allows Play store to update the apps on the foreground
  1546. // in the designated window.
  1547. type MaintenanceWindow struct {
  1548. // DurationMs: Duration of the maintenance window, in milliseconds. The
  1549. // duration must be between 30 minutes and 24 hours (inclusive).
  1550. DurationMs int64 `json:"durationMs,omitempty,string"`
  1551. // StartTimeAfterMidnightMs: Start time of the maintenance window, in
  1552. // milliseconds after midnight on the device. Windows can span midnight.
  1553. StartTimeAfterMidnightMs int64 `json:"startTimeAfterMidnightMs,omitempty,string"`
  1554. // ForceSendFields is a list of field names (e.g. "DurationMs") to
  1555. // unconditionally include in API requests. By default, fields with
  1556. // empty values are omitted from API requests. However, any non-pointer,
  1557. // non-interface field appearing in ForceSendFields will be sent to the
  1558. // server regardless of whether the field is empty or not. This may be
  1559. // used to include empty fields in Patch requests.
  1560. ForceSendFields []string `json:"-"`
  1561. // NullFields is a list of field names (e.g. "DurationMs") to include in
  1562. // API requests with the JSON null value. By default, fields with empty
  1563. // values are omitted from API requests. However, any field with an
  1564. // empty value appearing in NullFields will be sent to the server as
  1565. // null. It is an error if a field in this list has a non-empty value.
  1566. // This may be used to include null fields in Patch requests.
  1567. NullFields []string `json:"-"`
  1568. }
  1569. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1570. type NoMethod MaintenanceWindow
  1571. raw := NoMethod(*s)
  1572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1573. }
  1574. // ManagedConfiguration: A managed configuration resource contains the
  1575. // set of managed properties defined by the app developer in the app's
  1576. // managed configurations schema, as well as any configuration variables
  1577. // defined for the user.
  1578. type ManagedConfiguration struct {
  1579. // ConfigurationVariables: Contains the ID of the managed configuration
  1580. // profile and the set of configuration variables (if any) defined for
  1581. // the user.
  1582. ConfigurationVariables *ConfigurationVariables `json:"configurationVariables,omitempty"`
  1583. // Kind: Identifies what kind of resource this is. Value: the fixed
  1584. // string "androidenterprise#managedConfiguration".
  1585. Kind string `json:"kind,omitempty"`
  1586. // ManagedProperty: The set of managed properties for this
  1587. // configuration.
  1588. ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"`
  1589. // ProductId: The ID of the product that the managed configuration is
  1590. // for, e.g. "app:com.google.android.gm".
  1591. ProductId string `json:"productId,omitempty"`
  1592. // ServerResponse contains the HTTP response code and headers from the
  1593. // server.
  1594. googleapi.ServerResponse `json:"-"`
  1595. // ForceSendFields is a list of field names (e.g.
  1596. // "ConfigurationVariables") to unconditionally include in API requests.
  1597. // By default, fields with empty values are omitted from API requests.
  1598. // However, any non-pointer, non-interface field appearing in
  1599. // ForceSendFields will be sent to the server regardless of whether the
  1600. // field is empty or not. This may be used to include empty fields in
  1601. // Patch requests.
  1602. ForceSendFields []string `json:"-"`
  1603. // NullFields is a list of field names (e.g. "ConfigurationVariables")
  1604. // to include in API requests with the JSON null value. By default,
  1605. // fields with empty values are omitted from API requests. However, any
  1606. // field with an empty value appearing in NullFields will be sent to the
  1607. // server as null. It is an error if a field in this list has a
  1608. // non-empty value. This may be used to include null fields in Patch
  1609. // requests.
  1610. NullFields []string `json:"-"`
  1611. }
  1612. func (s *ManagedConfiguration) MarshalJSON() ([]byte, error) {
  1613. type NoMethod ManagedConfiguration
  1614. raw := NoMethod(*s)
  1615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1616. }
  1617. // ManagedConfigurationsForDeviceListResponse: The managed configuration
  1618. // resources for the device.
  1619. type ManagedConfigurationsForDeviceListResponse struct {
  1620. // Kind: Identifies what kind of resource this is. Value: the fixed
  1621. // string
  1622. // "androidenterprise#managedConfigurationsForDeviceListResponse".
  1623. Kind string `json:"kind,omitempty"`
  1624. // ManagedConfigurationForDevice: A managed configuration for an app on
  1625. // a specific device.
  1626. ManagedConfigurationForDevice []*ManagedConfiguration `json:"managedConfigurationForDevice,omitempty"`
  1627. // ServerResponse contains the HTTP response code and headers from the
  1628. // server.
  1629. googleapi.ServerResponse `json:"-"`
  1630. // ForceSendFields is a list of field names (e.g. "Kind") to
  1631. // unconditionally include in API requests. By default, fields with
  1632. // empty values are omitted from API requests. However, any non-pointer,
  1633. // non-interface field appearing in ForceSendFields will be sent to the
  1634. // server regardless of whether the field is empty or not. This may be
  1635. // used to include empty fields in Patch requests.
  1636. ForceSendFields []string `json:"-"`
  1637. // NullFields is a list of field names (e.g. "Kind") to include in API
  1638. // requests with the JSON null value. By default, fields with empty
  1639. // values are omitted from API requests. However, any field with an
  1640. // empty value appearing in NullFields will be sent to the server as
  1641. // null. It is an error if a field in this list has a non-empty value.
  1642. // This may be used to include null fields in Patch requests.
  1643. NullFields []string `json:"-"`
  1644. }
  1645. func (s *ManagedConfigurationsForDeviceListResponse) MarshalJSON() ([]byte, error) {
  1646. type NoMethod ManagedConfigurationsForDeviceListResponse
  1647. raw := NoMethod(*s)
  1648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1649. }
  1650. // ManagedConfigurationsForUserListResponse: The managed configuration
  1651. // resources for the user.
  1652. type ManagedConfigurationsForUserListResponse struct {
  1653. // Kind: Identifies what kind of resource this is. Value: the fixed
  1654. // string "androidenterprise#managedConfigurationsForUserListResponse".
  1655. Kind string `json:"kind,omitempty"`
  1656. // ManagedConfigurationForUser: A managed configuration for an app for a
  1657. // specific user.
  1658. ManagedConfigurationForUser []*ManagedConfiguration `json:"managedConfigurationForUser,omitempty"`
  1659. // ServerResponse contains the HTTP response code and headers from the
  1660. // server.
  1661. googleapi.ServerResponse `json:"-"`
  1662. // ForceSendFields is a list of field names (e.g. "Kind") to
  1663. // unconditionally include in API requests. By default, fields with
  1664. // empty values are omitted from API requests. However, any non-pointer,
  1665. // non-interface field appearing in ForceSendFields will be sent to the
  1666. // server regardless of whether the field is empty or not. This may be
  1667. // used to include empty fields in Patch requests.
  1668. ForceSendFields []string `json:"-"`
  1669. // NullFields is a list of field names (e.g. "Kind") to include in API
  1670. // requests with the JSON null value. By default, fields with empty
  1671. // values are omitted from API requests. However, any field with an
  1672. // empty value appearing in NullFields will be sent to the server as
  1673. // null. It is an error if a field in this list has a non-empty value.
  1674. // This may be used to include null fields in Patch requests.
  1675. NullFields []string `json:"-"`
  1676. }
  1677. func (s *ManagedConfigurationsForUserListResponse) MarshalJSON() ([]byte, error) {
  1678. type NoMethod ManagedConfigurationsForUserListResponse
  1679. raw := NoMethod(*s)
  1680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1681. }
  1682. // ManagedConfigurationsSettings: A managed configurations settings
  1683. // resource contains the set of managed properties that have been
  1684. // configured for an Android app to be applied to a set of users. The
  1685. // app's developer would have defined configurable properties in the
  1686. // managed configurations schema.
  1687. type ManagedConfigurationsSettings struct {
  1688. // Kind: Identifies what kind of resource this is. Value: the fixed
  1689. // string "androidenterprise#managedConfigurationsSettings".
  1690. Kind string `json:"kind,omitempty"`
  1691. // LastUpdatedTimestampMillis: The last updated time of the managed
  1692. // configuration settings in milliseconds since 1970-01-01T00:00:00Z.
  1693. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  1694. // ManagedProperty: The set of managed properties for this
  1695. // configuration.
  1696. ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"`
  1697. // McmId: The ID of the managed configurations settings.
  1698. McmId string `json:"mcmId,omitempty"`
  1699. // Name: The name of the managed configurations settings.
  1700. Name string `json:"name,omitempty"`
  1701. // ForceSendFields is a list of field names (e.g. "Kind") to
  1702. // unconditionally include in API requests. By default, fields with
  1703. // empty values are omitted from API requests. However, any non-pointer,
  1704. // non-interface field appearing in ForceSendFields will be sent to the
  1705. // server regardless of whether the field is empty or not. This may be
  1706. // used to include empty fields in Patch requests.
  1707. ForceSendFields []string `json:"-"`
  1708. // NullFields is a list of field names (e.g. "Kind") to include in API
  1709. // requests with the JSON null value. By default, fields with empty
  1710. // values are omitted from API requests. However, any field with an
  1711. // empty value appearing in NullFields will be sent to the server as
  1712. // null. It is an error if a field in this list has a non-empty value.
  1713. // This may be used to include null fields in Patch requests.
  1714. NullFields []string `json:"-"`
  1715. }
  1716. func (s *ManagedConfigurationsSettings) MarshalJSON() ([]byte, error) {
  1717. type NoMethod ManagedConfigurationsSettings
  1718. raw := NoMethod(*s)
  1719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1720. }
  1721. // ManagedConfigurationsSettingsListResponse: The managed configurations
  1722. // settings for a product.
  1723. type ManagedConfigurationsSettingsListResponse struct {
  1724. // Kind: Identifies what kind of resource this is. Value: the fixed
  1725. // string "androidenterprise#managedConfigurationsSettingsListResponse".
  1726. Kind string `json:"kind,omitempty"`
  1727. // ManagedConfigurationsSettings: A managed configurations settings for
  1728. // an app that may be assigned to a group of users in an enterprise.
  1729. ManagedConfigurationsSettings []*ManagedConfigurationsSettings `json:"managedConfigurationsSettings,omitempty"`
  1730. // ServerResponse contains the HTTP response code and headers from the
  1731. // server.
  1732. googleapi.ServerResponse `json:"-"`
  1733. // ForceSendFields is a list of field names (e.g. "Kind") to
  1734. // unconditionally include in API requests. By default, fields with
  1735. // empty values are omitted from API requests. However, any non-pointer,
  1736. // non-interface field appearing in ForceSendFields will be sent to the
  1737. // server regardless of whether the field is empty or not. This may be
  1738. // used to include empty fields in Patch requests.
  1739. ForceSendFields []string `json:"-"`
  1740. // NullFields is a list of field names (e.g. "Kind") to include in API
  1741. // requests with the JSON null value. By default, fields with empty
  1742. // values are omitted from API requests. However, any field with an
  1743. // empty value appearing in NullFields will be sent to the server as
  1744. // null. It is an error if a field in this list has a non-empty value.
  1745. // This may be used to include null fields in Patch requests.
  1746. NullFields []string `json:"-"`
  1747. }
  1748. func (s *ManagedConfigurationsSettingsListResponse) MarshalJSON() ([]byte, error) {
  1749. type NoMethod ManagedConfigurationsSettingsListResponse
  1750. raw := NoMethod(*s)
  1751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1752. }
  1753. // ManagedProperty: A managed property of a managed configuration. The
  1754. // property must match one of the properties in the app restrictions
  1755. // schema of the product. Exactly one of the value fields must be
  1756. // populated, and it must match the property's type in the app
  1757. // restrictions schema.
  1758. type ManagedProperty struct {
  1759. // Key: The unique key that identifies the property.
  1760. Key string `json:"key,omitempty"`
  1761. // ValueBool: The boolean value - this will only be present if type of
  1762. // the property is bool.
  1763. ValueBool bool `json:"valueBool,omitempty"`
  1764. // ValueBundle: The bundle of managed properties - this will only be
  1765. // present if type of the property is bundle.
  1766. ValueBundle *ManagedPropertyBundle `json:"valueBundle,omitempty"`
  1767. // ValueBundleArray: The list of bundles of properties - this will only
  1768. // be present if type of the property is bundle_array.
  1769. ValueBundleArray []*ManagedPropertyBundle `json:"valueBundleArray,omitempty"`
  1770. // ValueInteger: The integer value - this will only be present if type
  1771. // of the property is integer.
  1772. ValueInteger int64 `json:"valueInteger,omitempty"`
  1773. // ValueString: The string value - this will only be present if type of
  1774. // the property is string, choice or hidden.
  1775. ValueString string `json:"valueString,omitempty"`
  1776. // ValueStringArray: The list of string values - this will only be
  1777. // present if type of the property is multiselect.
  1778. ValueStringArray []string `json:"valueStringArray,omitempty"`
  1779. // ForceSendFields is a list of field names (e.g. "Key") to
  1780. // unconditionally include in API requests. By default, fields with
  1781. // empty values are omitted from API requests. However, any non-pointer,
  1782. // non-interface field appearing in ForceSendFields will be sent to the
  1783. // server regardless of whether the field is empty or not. This may be
  1784. // used to include empty fields in Patch requests.
  1785. ForceSendFields []string `json:"-"`
  1786. // NullFields is a list of field names (e.g. "Key") to include in API
  1787. // requests with the JSON null value. By default, fields with empty
  1788. // values are omitted from API requests. However, any field with an
  1789. // empty value appearing in NullFields will be sent to the server as
  1790. // null. It is an error if a field in this list has a non-empty value.
  1791. // This may be used to include null fields in Patch requests.
  1792. NullFields []string `json:"-"`
  1793. }
  1794. func (s *ManagedProperty) MarshalJSON() ([]byte, error) {
  1795. type NoMethod ManagedProperty
  1796. raw := NoMethod(*s)
  1797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1798. }
  1799. // ManagedPropertyBundle: A bundle of managed properties.
  1800. type ManagedPropertyBundle struct {
  1801. // ManagedProperty: The list of managed properties.
  1802. ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"`
  1803. // ForceSendFields is a list of field names (e.g. "ManagedProperty") to
  1804. // unconditionally include in API requests. By default, fields with
  1805. // empty values are omitted from API requests. However, any non-pointer,
  1806. // non-interface field appearing in ForceSendFields will be sent to the
  1807. // server regardless of whether the field is empty or not. This may be
  1808. // used to include empty fields in Patch requests.
  1809. ForceSendFields []string `json:"-"`
  1810. // NullFields is a list of field names (e.g. "ManagedProperty") to
  1811. // include in API requests with the JSON null value. By default, fields
  1812. // with empty values are omitted from API requests. However, any field
  1813. // with an empty value appearing in NullFields will be sent to the
  1814. // server as null. It is an error if a field in this list has a
  1815. // non-empty value. This may be used to include null fields in Patch
  1816. // requests.
  1817. NullFields []string `json:"-"`
  1818. }
  1819. func (s *ManagedPropertyBundle) MarshalJSON() ([]byte, error) {
  1820. type NoMethod ManagedPropertyBundle
  1821. raw := NoMethod(*s)
  1822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1823. }
  1824. // NewDeviceEvent: An event generated when a new device is ready to be
  1825. // managed.
  1826. type NewDeviceEvent struct {
  1827. // DeviceId: The Android ID of the device. This field will always be
  1828. // present.
  1829. DeviceId string `json:"deviceId,omitempty"`
  1830. // DpcPackageName: Policy app on the device.
  1831. DpcPackageName string `json:"dpcPackageName,omitempty"`
  1832. // ManagementType: Identifies the extent to which the device is
  1833. // controlled by an Android EMM in various deployment
  1834. // configurations.
  1835. //
  1836. // Possible values include:
  1837. // - "managedDevice", a device where the DPC is set as device owner,
  1838. // - "managedProfile", a device where the DPC is set as profile owner.
  1839. ManagementType string `json:"managementType,omitempty"`
  1840. // UserId: The ID of the user. This field will always be present.
  1841. UserId string `json:"userId,omitempty"`
  1842. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1843. // unconditionally include in API requests. By default, fields with
  1844. // empty values are omitted from API requests. However, any non-pointer,
  1845. // non-interface field appearing in ForceSendFields will be sent to the
  1846. // server regardless of whether the field is empty or not. This may be
  1847. // used to include empty fields in Patch requests.
  1848. ForceSendFields []string `json:"-"`
  1849. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1850. // API requests with the JSON null value. By default, fields with empty
  1851. // values are omitted from API requests. However, any field with an
  1852. // empty value appearing in NullFields will be sent to the server as
  1853. // null. It is an error if a field in this list has a non-empty value.
  1854. // This may be used to include null fields in Patch requests.
  1855. NullFields []string `json:"-"`
  1856. }
  1857. func (s *NewDeviceEvent) MarshalJSON() ([]byte, error) {
  1858. type NoMethod NewDeviceEvent
  1859. raw := NoMethod(*s)
  1860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1861. }
  1862. // NewPermissionsEvent: An event generated when new permissions are
  1863. // added to an app.
  1864. type NewPermissionsEvent struct {
  1865. // ApprovedPermissions: The set of permissions that the enterprise admin
  1866. // has already approved for this application. Use Permissions.Get on the
  1867. // EMM API to retrieve details about these permissions.
  1868. ApprovedPermissions []string `json:"approvedPermissions,omitempty"`
  1869. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  1870. // for which new permissions were added. This field will always be
  1871. // present.
  1872. ProductId string `json:"productId,omitempty"`
  1873. // RequestedPermissions: The set of permissions that the app is
  1874. // currently requesting. Use Permissions.Get on the EMM API to retrieve
  1875. // details about these permissions.
  1876. RequestedPermissions []string `json:"requestedPermissions,omitempty"`
  1877. // ForceSendFields is a list of field names (e.g. "ApprovedPermissions")
  1878. // to unconditionally include in API requests. By default, fields with
  1879. // empty values are omitted from API requests. However, any non-pointer,
  1880. // non-interface field appearing in ForceSendFields will be sent to the
  1881. // server regardless of whether the field is empty or not. This may be
  1882. // used to include empty fields in Patch requests.
  1883. ForceSendFields []string `json:"-"`
  1884. // NullFields is a list of field names (e.g. "ApprovedPermissions") to
  1885. // include in API requests with the JSON null value. By default, fields
  1886. // with empty values are omitted from API requests. However, any field
  1887. // with an empty value appearing in NullFields will be sent to the
  1888. // server as null. It is an error if a field in this list has a
  1889. // non-empty value. This may be used to include null fields in Patch
  1890. // requests.
  1891. NullFields []string `json:"-"`
  1892. }
  1893. func (s *NewPermissionsEvent) MarshalJSON() ([]byte, error) {
  1894. type NoMethod NewPermissionsEvent
  1895. raw := NoMethod(*s)
  1896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1897. }
  1898. // Notification: A notification of one event relating to an enterprise.
  1899. type Notification struct {
  1900. // AppRestrictionsSchemaChangeEvent: Notifications about new app
  1901. // restrictions schema changes.
  1902. AppRestrictionsSchemaChangeEvent *AppRestrictionsSchemaChangeEvent `json:"appRestrictionsSchemaChangeEvent,omitempty"`
  1903. // AppUpdateEvent: Notifications about app updates.
  1904. AppUpdateEvent *AppUpdateEvent `json:"appUpdateEvent,omitempty"`
  1905. // EnterpriseId: The ID of the enterprise for which the notification is
  1906. // sent. This will always be present.
  1907. EnterpriseId string `json:"enterpriseId,omitempty"`
  1908. // InstallFailureEvent: Notifications about an app installation failure.
  1909. InstallFailureEvent *InstallFailureEvent `json:"installFailureEvent,omitempty"`
  1910. // NewDeviceEvent: Notifications about new devices.
  1911. NewDeviceEvent *NewDeviceEvent `json:"newDeviceEvent,omitempty"`
  1912. // NewPermissionsEvent: Notifications about new app permissions.
  1913. NewPermissionsEvent *NewPermissionsEvent `json:"newPermissionsEvent,omitempty"`
  1914. // NotificationType: Type of the notification.
  1915. NotificationType string `json:"notificationType,omitempty"`
  1916. // ProductApprovalEvent: Notifications about changes to a product's
  1917. // approval status.
  1918. ProductApprovalEvent *ProductApprovalEvent `json:"productApprovalEvent,omitempty"`
  1919. // ProductAvailabilityChangeEvent: Notifications about product
  1920. // availability changes.
  1921. ProductAvailabilityChangeEvent *ProductAvailabilityChangeEvent `json:"productAvailabilityChangeEvent,omitempty"`
  1922. // TimestampMillis: The time when the notification was published in
  1923. // milliseconds since 1970-01-01T00:00:00Z. This will always be present.
  1924. TimestampMillis int64 `json:"timestampMillis,omitempty,string"`
  1925. // ForceSendFields is a list of field names (e.g.
  1926. // "AppRestrictionsSchemaChangeEvent") to unconditionally include in API
  1927. // requests. By default, fields with empty values are omitted from API
  1928. // requests. However, any non-pointer, non-interface field appearing in
  1929. // ForceSendFields will be sent to the server regardless of whether the
  1930. // field is empty or not. This may be used to include empty fields in
  1931. // Patch requests.
  1932. ForceSendFields []string `json:"-"`
  1933. // NullFields is a list of field names (e.g.
  1934. // "AppRestrictionsSchemaChangeEvent") to include in API requests with
  1935. // the JSON null value. By default, fields with empty values are omitted
  1936. // from API requests. However, any field with an empty value appearing
  1937. // in NullFields will be sent to the server as null. It is an error if a
  1938. // field in this list has a non-empty value. This may be used to include
  1939. // null fields in Patch requests.
  1940. NullFields []string `json:"-"`
  1941. }
  1942. func (s *Notification) MarshalJSON() ([]byte, error) {
  1943. type NoMethod Notification
  1944. raw := NoMethod(*s)
  1945. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1946. }
  1947. // NotificationSet: A resource returned by the PullNotificationSet API,
  1948. // which contains a collection of notifications for enterprises
  1949. // associated with the service account authenticated for the request.
  1950. type NotificationSet struct {
  1951. // Kind: Identifies what kind of resource this is. Value: the fixed
  1952. // string "androidenterprise#notificationSet".
  1953. Kind string `json:"kind,omitempty"`
  1954. // Notification: The notifications received, or empty if no
  1955. // notifications are present.
  1956. Notification []*Notification `json:"notification,omitempty"`
  1957. // NotificationSetId: The notification set ID, required to mark the
  1958. // notification as received with the Enterprises.AcknowledgeNotification
  1959. // API. This will be omitted if no notifications are present.
  1960. NotificationSetId string `json:"notificationSetId,omitempty"`
  1961. // ServerResponse contains the HTTP response code and headers from the
  1962. // server.
  1963. googleapi.ServerResponse `json:"-"`
  1964. // ForceSendFields is a list of field names (e.g. "Kind") to
  1965. // unconditionally include in API requests. By default, fields with
  1966. // empty values are omitted from API requests. However, any non-pointer,
  1967. // non-interface field appearing in ForceSendFields will be sent to the
  1968. // server regardless of whether the field is empty or not. This may be
  1969. // used to include empty fields in Patch requests.
  1970. ForceSendFields []string `json:"-"`
  1971. // NullFields is a list of field names (e.g. "Kind") to include in API
  1972. // requests with the JSON null value. By default, fields with empty
  1973. // values are omitted from API requests. However, any field with an
  1974. // empty value appearing in NullFields will be sent to the server as
  1975. // null. It is an error if a field in this list has a non-empty value.
  1976. // This may be used to include null fields in Patch requests.
  1977. NullFields []string `json:"-"`
  1978. }
  1979. func (s *NotificationSet) MarshalJSON() ([]byte, error) {
  1980. type NoMethod NotificationSet
  1981. raw := NoMethod(*s)
  1982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1983. }
  1984. type PageInfo struct {
  1985. ResultPerPage int64 `json:"resultPerPage,omitempty"`
  1986. StartIndex int64 `json:"startIndex,omitempty"`
  1987. TotalResults int64 `json:"totalResults,omitempty"`
  1988. // ForceSendFields is a list of field names (e.g. "ResultPerPage") to
  1989. // unconditionally include in API requests. By default, fields with
  1990. // empty values are omitted from API requests. However, any non-pointer,
  1991. // non-interface field appearing in ForceSendFields will be sent to the
  1992. // server regardless of whether the field is empty or not. This may be
  1993. // used to include empty fields in Patch requests.
  1994. ForceSendFields []string `json:"-"`
  1995. // NullFields is a list of field names (e.g. "ResultPerPage") to include
  1996. // in API requests with the JSON null value. By default, fields with
  1997. // empty values are omitted from API requests. However, any field with
  1998. // an empty value appearing in NullFields will be sent to the server as
  1999. // null. It is an error if a field in this list has a non-empty value.
  2000. // This may be used to include null fields in Patch requests.
  2001. NullFields []string `json:"-"`
  2002. }
  2003. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  2004. type NoMethod PageInfo
  2005. raw := NoMethod(*s)
  2006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2007. }
  2008. // Permission: A Permissions resource represents some extra capability,
  2009. // to be granted to an Android app, which requires explicit consent. An
  2010. // enterprise admin must consent to these permissions on behalf of their
  2011. // users before an entitlement for the app can be created.
  2012. //
  2013. // The permissions collection is read-only. The information provided for
  2014. // each permission (localized name and description) is intended to be
  2015. // used in the MDM user interface when obtaining consent from the
  2016. // enterprise.
  2017. type Permission struct {
  2018. // Description: A longer description of the Permissions resource, giving
  2019. // more details of what it affects.
  2020. Description string `json:"description,omitempty"`
  2021. // Kind: Identifies what kind of resource this is. Value: the fixed
  2022. // string "androidenterprise#permission".
  2023. Kind string `json:"kind,omitempty"`
  2024. // Name: The name of the permission.
  2025. Name string `json:"name,omitempty"`
  2026. // PermissionId: An opaque string uniquely identifying the permission.
  2027. PermissionId string `json:"permissionId,omitempty"`
  2028. // ServerResponse contains the HTTP response code and headers from the
  2029. // server.
  2030. googleapi.ServerResponse `json:"-"`
  2031. // ForceSendFields is a list of field names (e.g. "Description") to
  2032. // unconditionally include in API requests. By default, fields with
  2033. // empty values are omitted from API requests. However, any non-pointer,
  2034. // non-interface field appearing in ForceSendFields will be sent to the
  2035. // server regardless of whether the field is empty or not. This may be
  2036. // used to include empty fields in Patch requests.
  2037. ForceSendFields []string `json:"-"`
  2038. // NullFields is a list of field names (e.g. "Description") to include
  2039. // in API requests with the JSON null value. By default, fields with
  2040. // empty values are omitted from API requests. However, any field with
  2041. // an empty value appearing in NullFields will be sent to the server as
  2042. // null. It is an error if a field in this list has a non-empty value.
  2043. // This may be used to include null fields in Patch requests.
  2044. NullFields []string `json:"-"`
  2045. }
  2046. func (s *Permission) MarshalJSON() ([]byte, error) {
  2047. type NoMethod Permission
  2048. raw := NoMethod(*s)
  2049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2050. }
  2051. // Policy: The device policy for a given managed device.
  2052. type Policy struct {
  2053. // AutoUpdatePolicy: The auto-update policy for apps installed on the
  2054. // device. "choiceToTheUser" allows the device's user to configure the
  2055. // app update policy. "always" enables auto updates. "never" disables
  2056. // auto updates. "wifiOnly" enables auto updates only when the device is
  2057. // connected to wifi.
  2058. AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"`
  2059. // MaintenanceWindow: The maintenance window defining when apps running
  2060. // in the foreground should be updated.
  2061. MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
  2062. // ProductAvailabilityPolicy: The availability granted to the device for
  2063. // the specified products. "all" gives the device access to all
  2064. // products, regardless of approval status. "all" does not enable
  2065. // automatic visibility of "alpha" or "beta" tracks. "whitelist" grants
  2066. // the device access the products specified in productPolicy[]. Only
  2067. // products that are approved or products that were previously approved
  2068. // (products with revoked approval) by the enterprise can be
  2069. // whitelisted. If no value is provided, the availability set at the
  2070. // user level is applied by default.
  2071. ProductAvailabilityPolicy string `json:"productAvailabilityPolicy,omitempty"`
  2072. // ProductPolicy: The list of product policies.
  2073. ProductPolicy []*ProductPolicy `json:"productPolicy,omitempty"`
  2074. // ForceSendFields is a list of field names (e.g. "AutoUpdatePolicy") to
  2075. // unconditionally include in API requests. By default, fields with
  2076. // empty values are omitted from API requests. However, any non-pointer,
  2077. // non-interface field appearing in ForceSendFields will be sent to the
  2078. // server regardless of whether the field is empty or not. This may be
  2079. // used to include empty fields in Patch requests.
  2080. ForceSendFields []string `json:"-"`
  2081. // NullFields is a list of field names (e.g. "AutoUpdatePolicy") to
  2082. // include in API requests with the JSON null value. By default, fields
  2083. // with empty values are omitted from API requests. However, any field
  2084. // with an empty value appearing in NullFields will be sent to the
  2085. // server as null. It is an error if a field in this list has a
  2086. // non-empty value. This may be used to include null fields in Patch
  2087. // requests.
  2088. NullFields []string `json:"-"`
  2089. }
  2090. func (s *Policy) MarshalJSON() ([]byte, error) {
  2091. type NoMethod Policy
  2092. raw := NoMethod(*s)
  2093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2094. }
  2095. // Product: A Products resource represents an app in the Google Play
  2096. // store that is available to at least some users in the enterprise.
  2097. // (Some apps are restricted to a single enterprise, and no information
  2098. // about them is made available outside that enterprise.)
  2099. //
  2100. // The information provided for each product (localized name, icon, link
  2101. // to the full Google Play details page) is intended to allow a basic
  2102. // representation of the product within an EMM user interface.
  2103. type Product struct {
  2104. // AppTracks: The tracks visible to the enterprise.
  2105. AppTracks []*TrackInfo `json:"appTracks,omitempty"`
  2106. // AppVersion: App versions currently available for this product.
  2107. AppVersion []*AppVersion `json:"appVersion,omitempty"`
  2108. // AuthorName: The name of the author of the product (for example, the
  2109. // app developer).
  2110. AuthorName string `json:"authorName,omitempty"`
  2111. // AvailableCountries: The countries which this app is available in.
  2112. AvailableCountries []string `json:"availableCountries,omitempty"`
  2113. // AvailableTracks: Deprecated, use appTracks instead.
  2114. AvailableTracks []string `json:"availableTracks,omitempty"`
  2115. // Category: The app category (e.g. RACING, SOCIAL, etc.)
  2116. Category string `json:"category,omitempty"`
  2117. // ContentRating: The content rating for this app.
  2118. ContentRating string `json:"contentRating,omitempty"`
  2119. // Description: The localized promotional description, if available.
  2120. Description string `json:"description,omitempty"`
  2121. // DetailsUrl: A link to the (consumer) Google Play details page for the
  2122. // product.
  2123. DetailsUrl string `json:"detailsUrl,omitempty"`
  2124. // DistributionChannel: How and to whom the package is made available.
  2125. // The value publicGoogleHosted means that the package is available
  2126. // through the Play store and not restricted to a specific enterprise.
  2127. // The value privateGoogleHosted means that the package is a private app
  2128. // (restricted to an enterprise) but hosted by Google. The value
  2129. // privateSelfHosted means that the package is a private app (restricted
  2130. // to an enterprise) and is privately hosted.
  2131. DistributionChannel string `json:"distributionChannel,omitempty"`
  2132. // IconUrl: A link to an image that can be used as an icon for the
  2133. // product. This image is suitable for use at up to 512px x 512px.
  2134. IconUrl string `json:"iconUrl,omitempty"`
  2135. // Kind: Identifies what kind of resource this is. Value: the fixed
  2136. // string "androidenterprise#product".
  2137. Kind string `json:"kind,omitempty"`
  2138. // LastUpdatedTimestampMillis: The approximate time (within 7 days) the
  2139. // app was last published, expressed in milliseconds since epoch.
  2140. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  2141. // MinAndroidSdkVersion: The minimum Android SDK necessary to run the
  2142. // app.
  2143. MinAndroidSdkVersion int64 `json:"minAndroidSdkVersion,omitempty"`
  2144. // Permissions: A list of permissions required by the app.
  2145. Permissions []*ProductPermission `json:"permissions,omitempty"`
  2146. // ProductId: A string of the form app:<package name>. For example,
  2147. // app:com.google.android.gm represents the Gmail app.
  2148. ProductId string `json:"productId,omitempty"`
  2149. // ProductPricing: Whether this product is free, free with in-app
  2150. // purchases, or paid. If the pricing is unknown, this means the product
  2151. // is not generally available anymore (even though it might still be
  2152. // available to people who own it).
  2153. ProductPricing string `json:"productPricing,omitempty"`
  2154. // RecentChanges: A description of the recent changes made to the app.
  2155. RecentChanges string `json:"recentChanges,omitempty"`
  2156. // RequiresContainerApp: Deprecated.
  2157. RequiresContainerApp bool `json:"requiresContainerApp,omitempty"`
  2158. // ScreenshotUrls: A list of screenshot links representing the app.
  2159. ScreenshotUrls []string `json:"screenshotUrls,omitempty"`
  2160. // SigningCertificate: The certificate used to sign this product.
  2161. SigningCertificate *ProductSigningCertificate `json:"signingCertificate,omitempty"`
  2162. // SmallIconUrl: A link to a smaller image that can be used as an icon
  2163. // for the product. This image is suitable for use at up to 128px x
  2164. // 128px.
  2165. SmallIconUrl string `json:"smallIconUrl,omitempty"`
  2166. // Title: The name of the product.
  2167. Title string `json:"title,omitempty"`
  2168. // WorkDetailsUrl: A link to the managed Google Play details page for
  2169. // the product, for use by an Enterprise admin.
  2170. WorkDetailsUrl string `json:"workDetailsUrl,omitempty"`
  2171. // ServerResponse contains the HTTP response code and headers from the
  2172. // server.
  2173. googleapi.ServerResponse `json:"-"`
  2174. // ForceSendFields is a list of field names (e.g. "AppTracks") to
  2175. // unconditionally include in API requests. By default, fields with
  2176. // empty values are omitted from API requests. However, any non-pointer,
  2177. // non-interface field appearing in ForceSendFields will be sent to the
  2178. // server regardless of whether the field is empty or not. This may be
  2179. // used to include empty fields in Patch requests.
  2180. ForceSendFields []string `json:"-"`
  2181. // NullFields is a list of field names (e.g. "AppTracks") to include in
  2182. // API requests with the JSON null value. By default, fields with empty
  2183. // values are omitted from API requests. However, any field with an
  2184. // empty value appearing in NullFields will be sent to the server as
  2185. // null. It is an error if a field in this list has a non-empty value.
  2186. // This may be used to include null fields in Patch requests.
  2187. NullFields []string `json:"-"`
  2188. }
  2189. func (s *Product) MarshalJSON() ([]byte, error) {
  2190. type NoMethod Product
  2191. raw := NoMethod(*s)
  2192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2193. }
  2194. // ProductApprovalEvent: An event generated when a product's approval
  2195. // status is changed.
  2196. type ProductApprovalEvent struct {
  2197. // Approved: Whether the product was approved or unapproved. This field
  2198. // will always be present.
  2199. Approved string `json:"approved,omitempty"`
  2200. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  2201. // for which the approval status has changed. This field will always be
  2202. // present.
  2203. ProductId string `json:"productId,omitempty"`
  2204. // ForceSendFields is a list of field names (e.g. "Approved") to
  2205. // unconditionally include in API requests. By default, fields with
  2206. // empty values are omitted from API requests. However, any non-pointer,
  2207. // non-interface field appearing in ForceSendFields will be sent to the
  2208. // server regardless of whether the field is empty or not. This may be
  2209. // used to include empty fields in Patch requests.
  2210. ForceSendFields []string `json:"-"`
  2211. // NullFields is a list of field names (e.g. "Approved") to include in
  2212. // API requests with the JSON null value. By default, fields with empty
  2213. // values are omitted from API requests. However, any field with an
  2214. // empty value appearing in NullFields will be sent to the server as
  2215. // null. It is an error if a field in this list has a non-empty value.
  2216. // This may be used to include null fields in Patch requests.
  2217. NullFields []string `json:"-"`
  2218. }
  2219. func (s *ProductApprovalEvent) MarshalJSON() ([]byte, error) {
  2220. type NoMethod ProductApprovalEvent
  2221. raw := NoMethod(*s)
  2222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2223. }
  2224. // ProductAvailabilityChangeEvent: An event generated whenever a
  2225. // product's availability changes.
  2226. type ProductAvailabilityChangeEvent struct {
  2227. // AvailabilityStatus: The new state of the product. This field will
  2228. // always be present.
  2229. AvailabilityStatus string `json:"availabilityStatus,omitempty"`
  2230. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  2231. // for which the product availability changed. This field will always be
  2232. // present.
  2233. ProductId string `json:"productId,omitempty"`
  2234. // ForceSendFields is a list of field names (e.g. "AvailabilityStatus")
  2235. // to unconditionally include in API requests. By default, fields with
  2236. // empty values are omitted from API requests. However, any non-pointer,
  2237. // non-interface field appearing in ForceSendFields will be sent to the
  2238. // server regardless of whether the field is empty or not. This may be
  2239. // used to include empty fields in Patch requests.
  2240. ForceSendFields []string `json:"-"`
  2241. // NullFields is a list of field names (e.g. "AvailabilityStatus") to
  2242. // include in API requests with the JSON null value. By default, fields
  2243. // with empty values are omitted from API requests. However, any field
  2244. // with an empty value appearing in NullFields will be sent to the
  2245. // server as null. It is an error if a field in this list has a
  2246. // non-empty value. This may be used to include null fields in Patch
  2247. // requests.
  2248. NullFields []string `json:"-"`
  2249. }
  2250. func (s *ProductAvailabilityChangeEvent) MarshalJSON() ([]byte, error) {
  2251. type NoMethod ProductAvailabilityChangeEvent
  2252. raw := NoMethod(*s)
  2253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2254. }
  2255. // ProductPermission: A product permissions resource represents the set
  2256. // of permissions required by a specific app and whether or not they
  2257. // have been accepted by an enterprise admin.
  2258. //
  2259. // The API can be used to read the set of permissions, and also to
  2260. // update the set to indicate that permissions have been accepted.
  2261. type ProductPermission struct {
  2262. // PermissionId: An opaque string uniquely identifying the permission.
  2263. PermissionId string `json:"permissionId,omitempty"`
  2264. // State: Whether the permission has been accepted or not.
  2265. State string `json:"state,omitempty"`
  2266. // ForceSendFields is a list of field names (e.g. "PermissionId") to
  2267. // unconditionally include in API requests. By default, fields with
  2268. // empty values are omitted from API requests. However, any non-pointer,
  2269. // non-interface field appearing in ForceSendFields will be sent to the
  2270. // server regardless of whether the field is empty or not. This may be
  2271. // used to include empty fields in Patch requests.
  2272. ForceSendFields []string `json:"-"`
  2273. // NullFields is a list of field names (e.g. "PermissionId") to include
  2274. // in API requests with the JSON null value. By default, fields with
  2275. // empty values are omitted from API requests. However, any field with
  2276. // an empty value appearing in NullFields will be sent to the server as
  2277. // null. It is an error if a field in this list has a non-empty value.
  2278. // This may be used to include null fields in Patch requests.
  2279. NullFields []string `json:"-"`
  2280. }
  2281. func (s *ProductPermission) MarshalJSON() ([]byte, error) {
  2282. type NoMethod ProductPermission
  2283. raw := NoMethod(*s)
  2284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2285. }
  2286. // ProductPermissions: Information about the permissions required by a
  2287. // specific app and whether they have been accepted by the enterprise.
  2288. type ProductPermissions struct {
  2289. // Kind: Identifies what kind of resource this is. Value: the fixed
  2290. // string "androidenterprise#productPermissions".
  2291. Kind string `json:"kind,omitempty"`
  2292. // Permission: The permissions required by the app.
  2293. Permission []*ProductPermission `json:"permission,omitempty"`
  2294. // ProductId: The ID of the app that the permissions relate to, e.g.
  2295. // "app:com.google.android.gm".
  2296. ProductId string `json:"productId,omitempty"`
  2297. // ServerResponse contains the HTTP response code and headers from the
  2298. // server.
  2299. googleapi.ServerResponse `json:"-"`
  2300. // ForceSendFields is a list of field names (e.g. "Kind") to
  2301. // unconditionally include in API requests. By default, fields with
  2302. // empty values are omitted from API requests. However, any non-pointer,
  2303. // non-interface field appearing in ForceSendFields will be sent to the
  2304. // server regardless of whether the field is empty or not. This may be
  2305. // used to include empty fields in Patch requests.
  2306. ForceSendFields []string `json:"-"`
  2307. // NullFields is a list of field names (e.g. "Kind") to include in API
  2308. // requests with the JSON null value. By default, fields with empty
  2309. // values are omitted from API requests. However, any field with an
  2310. // empty value appearing in NullFields will be sent to the server as
  2311. // null. It is an error if a field in this list has a non-empty value.
  2312. // This may be used to include null fields in Patch requests.
  2313. NullFields []string `json:"-"`
  2314. }
  2315. func (s *ProductPermissions) MarshalJSON() ([]byte, error) {
  2316. type NoMethod ProductPermissions
  2317. raw := NoMethod(*s)
  2318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2319. }
  2320. // ProductPolicy: The policy for a product.
  2321. type ProductPolicy struct {
  2322. // AutoInstallPolicy: The auto-install policy for the product.
  2323. AutoInstallPolicy *AutoInstallPolicy `json:"autoInstallPolicy,omitempty"`
  2324. // ProductId: The ID of the product. For example,
  2325. // "app:com.google.android.gm".
  2326. ProductId string `json:"productId,omitempty"`
  2327. // TrackIds: Grants the device visibility to the specified product
  2328. // release track(s), identified by trackIds. The list of release tracks
  2329. // of a product can be obtained by calling Products.Get.
  2330. TrackIds []string `json:"trackIds,omitempty"`
  2331. // Tracks: Deprecated. Use trackIds instead.
  2332. Tracks []string `json:"tracks,omitempty"`
  2333. // ForceSendFields is a list of field names (e.g. "AutoInstallPolicy")
  2334. // to unconditionally include in API requests. By default, fields with
  2335. // empty values are omitted from API requests. However, any non-pointer,
  2336. // non-interface field appearing in ForceSendFields will be sent to the
  2337. // server regardless of whether the field is empty or not. This may be
  2338. // used to include empty fields in Patch requests.
  2339. ForceSendFields []string `json:"-"`
  2340. // NullFields is a list of field names (e.g. "AutoInstallPolicy") to
  2341. // include in API requests with the JSON null value. By default, fields
  2342. // with empty values are omitted from API requests. However, any field
  2343. // with an empty value appearing in NullFields will be sent to the
  2344. // server as null. It is an error if a field in this list has a
  2345. // non-empty value. This may be used to include null fields in Patch
  2346. // requests.
  2347. NullFields []string `json:"-"`
  2348. }
  2349. func (s *ProductPolicy) MarshalJSON() ([]byte, error) {
  2350. type NoMethod ProductPolicy
  2351. raw := NoMethod(*s)
  2352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2353. }
  2354. // ProductSet: A set of products.
  2355. type ProductSet struct {
  2356. // Kind: Identifies what kind of resource this is. Value: the fixed
  2357. // string "androidenterprise#productSet".
  2358. Kind string `json:"kind,omitempty"`
  2359. // ProductId: The list of product IDs making up the set of products.
  2360. ProductId []string `json:"productId,omitempty"`
  2361. // ProductSetBehavior: The interpretation of this product set. "unknown"
  2362. // should never be sent and is ignored if received. "whitelist" means
  2363. // that the user is entitled to access the product set. "includeAll"
  2364. // means that all products are accessible, including products that are
  2365. // approved, products with revoked approval, and products that have
  2366. // never been approved. "allApproved" means that the user is entitled to
  2367. // access all products that are approved for the enterprise. If the
  2368. // value is "allApproved" or "includeAll", the productId field is
  2369. // ignored. If no value is provided, it is interpreted as "whitelist"
  2370. // for backwards compatibility. Further "allApproved" or "includeAll"
  2371. // does not enable automatic visibility of "alpha" or "beta" tracks for
  2372. // Android app. Use ProductVisibility to enable "alpha" or "beta" tracks
  2373. // per user.
  2374. ProductSetBehavior string `json:"productSetBehavior,omitempty"`
  2375. // ProductVisibility: Additional list of product IDs making up the
  2376. // product set. Unlike the productID array, in this list It's possible
  2377. // to specify which tracks (alpha, beta, production) of a product are
  2378. // visible to the user. See ProductVisibility and its fields for more
  2379. // information. Specifying the same product ID both here and in the
  2380. // productId array is not allowed and it will result in an error.
  2381. ProductVisibility []*ProductVisibility `json:"productVisibility,omitempty"`
  2382. // ServerResponse contains the HTTP response code and headers from the
  2383. // server.
  2384. googleapi.ServerResponse `json:"-"`
  2385. // ForceSendFields is a list of field names (e.g. "Kind") to
  2386. // unconditionally include in API requests. By default, fields with
  2387. // empty values are omitted from API requests. However, any non-pointer,
  2388. // non-interface field appearing in ForceSendFields will be sent to the
  2389. // server regardless of whether the field is empty or not. This may be
  2390. // used to include empty fields in Patch requests.
  2391. ForceSendFields []string `json:"-"`
  2392. // NullFields is a list of field names (e.g. "Kind") to include in API
  2393. // requests with the JSON null value. By default, fields with empty
  2394. // values are omitted from API requests. However, any field with an
  2395. // empty value appearing in NullFields will be sent to the server as
  2396. // null. It is an error if a field in this list has a non-empty value.
  2397. // This may be used to include null fields in Patch requests.
  2398. NullFields []string `json:"-"`
  2399. }
  2400. func (s *ProductSet) MarshalJSON() ([]byte, error) {
  2401. type NoMethod ProductSet
  2402. raw := NoMethod(*s)
  2403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2404. }
  2405. type ProductSigningCertificate struct {
  2406. // CertificateHashSha1: The base64 urlsafe encoded SHA1 hash of the
  2407. // certificate. (This field is deprecated in favor of SHA2-256. It
  2408. // should not be used and may be removed at any time.)
  2409. CertificateHashSha1 string `json:"certificateHashSha1,omitempty"`
  2410. // CertificateHashSha256: The base64 urlsafe encoded SHA2-256 hash of
  2411. // the certificate.
  2412. CertificateHashSha256 string `json:"certificateHashSha256,omitempty"`
  2413. // ForceSendFields is a list of field names (e.g. "CertificateHashSha1")
  2414. // to unconditionally include in API requests. By default, fields with
  2415. // empty values are omitted from API requests. However, any non-pointer,
  2416. // non-interface field appearing in ForceSendFields will be sent to the
  2417. // server regardless of whether the field is empty or not. This may be
  2418. // used to include empty fields in Patch requests.
  2419. ForceSendFields []string `json:"-"`
  2420. // NullFields is a list of field names (e.g. "CertificateHashSha1") to
  2421. // include in API requests with the JSON null value. By default, fields
  2422. // with empty values are omitted from API requests. However, any field
  2423. // with an empty value appearing in NullFields will be sent to the
  2424. // server as null. It is an error if a field in this list has a
  2425. // non-empty value. This may be used to include null fields in Patch
  2426. // requests.
  2427. NullFields []string `json:"-"`
  2428. }
  2429. func (s *ProductSigningCertificate) MarshalJSON() ([]byte, error) {
  2430. type NoMethod ProductSigningCertificate
  2431. raw := NoMethod(*s)
  2432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2433. }
  2434. // ProductVisibility: A product to be made visible to a user.
  2435. type ProductVisibility struct {
  2436. // ProductId: The product ID to make visible to the user. Required for
  2437. // each item in the productVisibility list.
  2438. ProductId string `json:"productId,omitempty"`
  2439. // TrackIds: Grants the user visibility to the specified product
  2440. // track(s), identified by trackIds.
  2441. TrackIds []string `json:"trackIds,omitempty"`
  2442. // Tracks: Deprecated. Use trackIds instead.
  2443. Tracks []string `json:"tracks,omitempty"`
  2444. // ForceSendFields is a list of field names (e.g. "ProductId") to
  2445. // unconditionally include in API requests. By default, fields with
  2446. // empty values are omitted from API requests. However, any non-pointer,
  2447. // non-interface field appearing in ForceSendFields will be sent to the
  2448. // server regardless of whether the field is empty or not. This may be
  2449. // used to include empty fields in Patch requests.
  2450. ForceSendFields []string `json:"-"`
  2451. // NullFields is a list of field names (e.g. "ProductId") to include in
  2452. // API requests with the JSON null value. By default, fields with empty
  2453. // values are omitted from API requests. However, any field with an
  2454. // empty value appearing in NullFields will be sent to the server as
  2455. // null. It is an error if a field in this list has a non-empty value.
  2456. // This may be used to include null fields in Patch requests.
  2457. NullFields []string `json:"-"`
  2458. }
  2459. func (s *ProductVisibility) MarshalJSON() ([]byte, error) {
  2460. type NoMethod ProductVisibility
  2461. raw := NoMethod(*s)
  2462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2463. }
  2464. type ProductsApproveRequest struct {
  2465. // ApprovalUrlInfo: The approval URL that was shown to the user. Only
  2466. // the permissions shown to the user with that URL will be accepted,
  2467. // which may not be the product's entire set of permissions. For
  2468. // example, the URL may only display new permissions from an update
  2469. // after the product was approved, or not include new permissions if the
  2470. // product was updated since the URL was generated.
  2471. ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"`
  2472. // ApprovedPermissions: Sets how new permission requests for the product
  2473. // are handled. "allPermissions" automatically approves all current and
  2474. // future permissions for the product. "currentPermissionsOnly" approves
  2475. // the current set of permissions for the product, but any future
  2476. // permissions added through updates will require manual reapproval. If
  2477. // not specified, only the current set of permissions will be approved.
  2478. ApprovedPermissions string `json:"approvedPermissions,omitempty"`
  2479. // ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to
  2480. // unconditionally include in API requests. By default, fields with
  2481. // empty values are omitted from API requests. However, any non-pointer,
  2482. // non-interface field appearing in ForceSendFields will be sent to the
  2483. // server regardless of whether the field is empty or not. This may be
  2484. // used to include empty fields in Patch requests.
  2485. ForceSendFields []string `json:"-"`
  2486. // NullFields is a list of field names (e.g. "ApprovalUrlInfo") to
  2487. // include in API requests with the JSON null value. By default, fields
  2488. // with empty values are omitted from API requests. However, any field
  2489. // with an empty value appearing in NullFields will be sent to the
  2490. // server as null. It is an error if a field in this list has a
  2491. // non-empty value. This may be used to include null fields in Patch
  2492. // requests.
  2493. NullFields []string `json:"-"`
  2494. }
  2495. func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) {
  2496. type NoMethod ProductsApproveRequest
  2497. raw := NoMethod(*s)
  2498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2499. }
  2500. type ProductsGenerateApprovalUrlResponse struct {
  2501. // Url: A URL that can be rendered in an iframe to display the
  2502. // permissions (if any) of a product. This URL can be used to approve
  2503. // the product only once and only within 24 hours of being generated,
  2504. // using the Products.approve call. If the product is currently
  2505. // unapproved and has no permissions, this URL will point to an empty
  2506. // page. If the product is currently approved, a URL will only be
  2507. // generated if that product has added permissions since it was last
  2508. // approved, and the URL will only display those new permissions that
  2509. // have not yet been accepted.
  2510. Url string `json:"url,omitempty"`
  2511. // ServerResponse contains the HTTP response code and headers from the
  2512. // server.
  2513. googleapi.ServerResponse `json:"-"`
  2514. // ForceSendFields is a list of field names (e.g. "Url") to
  2515. // unconditionally include in API requests. By default, fields with
  2516. // empty values are omitted from API requests. However, any non-pointer,
  2517. // non-interface field appearing in ForceSendFields will be sent to the
  2518. // server regardless of whether the field is empty or not. This may be
  2519. // used to include empty fields in Patch requests.
  2520. ForceSendFields []string `json:"-"`
  2521. // NullFields is a list of field names (e.g. "Url") to include in API
  2522. // requests with the JSON null value. By default, fields with empty
  2523. // values are omitted from API requests. However, any field with an
  2524. // empty value appearing in NullFields will be sent to the server as
  2525. // null. It is an error if a field in this list has a non-empty value.
  2526. // This may be used to include null fields in Patch requests.
  2527. NullFields []string `json:"-"`
  2528. }
  2529. func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) {
  2530. type NoMethod ProductsGenerateApprovalUrlResponse
  2531. raw := NoMethod(*s)
  2532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2533. }
  2534. // ProductsListResponse: The matching products.
  2535. type ProductsListResponse struct {
  2536. // Kind: Identifies what kind of resource this is. Value: the fixed
  2537. // string "androidenterprise#productsListResponse".
  2538. Kind string `json:"kind,omitempty"`
  2539. // PageInfo: General pagination information.
  2540. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2541. // Product: Information about a product (e.g. an app) in the Google Play
  2542. // store, for display to an enterprise admin.
  2543. Product []*Product `json:"product,omitempty"`
  2544. // TokenPagination: Pagination information for token pagination.
  2545. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2546. // ServerResponse contains the HTTP response code and headers from the
  2547. // server.
  2548. googleapi.ServerResponse `json:"-"`
  2549. // ForceSendFields is a list of field names (e.g. "Kind") to
  2550. // unconditionally include in API requests. By default, fields with
  2551. // empty values are omitted from API requests. However, any non-pointer,
  2552. // non-interface field appearing in ForceSendFields will be sent to the
  2553. // server regardless of whether the field is empty or not. This may be
  2554. // used to include empty fields in Patch requests.
  2555. ForceSendFields []string `json:"-"`
  2556. // NullFields is a list of field names (e.g. "Kind") to include in API
  2557. // requests with the JSON null value. By default, fields with empty
  2558. // values are omitted from API requests. However, any field with an
  2559. // empty value appearing in NullFields will be sent to the server as
  2560. // null. It is an error if a field in this list has a non-empty value.
  2561. // This may be used to include null fields in Patch requests.
  2562. NullFields []string `json:"-"`
  2563. }
  2564. func (s *ProductsListResponse) MarshalJSON() ([]byte, error) {
  2565. type NoMethod ProductsListResponse
  2566. raw := NoMethod(*s)
  2567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2568. }
  2569. // ServiceAccount: A service account identity, including the name and
  2570. // credentials that can be used to authenticate as the service account.
  2571. type ServiceAccount struct {
  2572. // Key: Credentials that can be used to authenticate as this
  2573. // ServiceAccount.
  2574. Key *ServiceAccountKey `json:"key,omitempty"`
  2575. // Kind: Identifies what kind of resource this is. Value: the fixed
  2576. // string "androidenterprise#serviceAccount".
  2577. Kind string `json:"kind,omitempty"`
  2578. // Name: The account name of the service account, in the form of an
  2579. // email address. Assigned by the server.
  2580. Name string `json:"name,omitempty"`
  2581. // ServerResponse contains the HTTP response code and headers from the
  2582. // server.
  2583. googleapi.ServerResponse `json:"-"`
  2584. // ForceSendFields is a list of field names (e.g. "Key") to
  2585. // unconditionally include in API requests. By default, fields with
  2586. // empty values are omitted from API requests. However, any non-pointer,
  2587. // non-interface field appearing in ForceSendFields will be sent to the
  2588. // server regardless of whether the field is empty or not. This may be
  2589. // used to include empty fields in Patch requests.
  2590. ForceSendFields []string `json:"-"`
  2591. // NullFields is a list of field names (e.g. "Key") to include in API
  2592. // requests with the JSON null value. By default, fields with empty
  2593. // values are omitted from API requests. However, any field with an
  2594. // empty value appearing in NullFields will be sent to the server as
  2595. // null. It is an error if a field in this list has a non-empty value.
  2596. // This may be used to include null fields in Patch requests.
  2597. NullFields []string `json:"-"`
  2598. }
  2599. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  2600. type NoMethod ServiceAccount
  2601. raw := NoMethod(*s)
  2602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2603. }
  2604. // ServiceAccountKey: Credentials that can be used to authenticate as a
  2605. // service account.
  2606. type ServiceAccountKey struct {
  2607. // Data: The body of the private key credentials file, in string format.
  2608. // This is only populated when the ServiceAccountKey is created, and is
  2609. // not stored by Google.
  2610. Data string `json:"data,omitempty"`
  2611. // Id: An opaque, unique identifier for this ServiceAccountKey. Assigned
  2612. // by the server.
  2613. Id string `json:"id,omitempty"`
  2614. // Kind: Identifies what kind of resource this is. Value: the fixed
  2615. // string "androidenterprise#serviceAccountKey".
  2616. Kind string `json:"kind,omitempty"`
  2617. // PublicData: Public key data for the credentials file. This is an
  2618. // X.509 cert. If you are using the googleCredentials key type, this is
  2619. // identical to the cert that can be retrieved by using the X.509 cert
  2620. // url inside of the credentials file.
  2621. PublicData string `json:"publicData,omitempty"`
  2622. // Type: The file format of the generated key data.
  2623. Type string `json:"type,omitempty"`
  2624. // ServerResponse contains the HTTP response code and headers from the
  2625. // server.
  2626. googleapi.ServerResponse `json:"-"`
  2627. // ForceSendFields is a list of field names (e.g. "Data") to
  2628. // unconditionally include in API requests. By default, fields with
  2629. // empty values are omitted from API requests. However, any non-pointer,
  2630. // non-interface field appearing in ForceSendFields will be sent to the
  2631. // server regardless of whether the field is empty or not. This may be
  2632. // used to include empty fields in Patch requests.
  2633. ForceSendFields []string `json:"-"`
  2634. // NullFields is a list of field names (e.g. "Data") to include in API
  2635. // requests with the JSON null value. By default, fields with empty
  2636. // values are omitted from API requests. However, any field with an
  2637. // empty value appearing in NullFields will be sent to the server as
  2638. // null. It is an error if a field in this list has a non-empty value.
  2639. // This may be used to include null fields in Patch requests.
  2640. NullFields []string `json:"-"`
  2641. }
  2642. func (s *ServiceAccountKey) MarshalJSON() ([]byte, error) {
  2643. type NoMethod ServiceAccountKey
  2644. raw := NoMethod(*s)
  2645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2646. }
  2647. type ServiceAccountKeysListResponse struct {
  2648. // ServiceAccountKey: The service account credentials.
  2649. ServiceAccountKey []*ServiceAccountKey `json:"serviceAccountKey,omitempty"`
  2650. // ServerResponse contains the HTTP response code and headers from the
  2651. // server.
  2652. googleapi.ServerResponse `json:"-"`
  2653. // ForceSendFields is a list of field names (e.g. "ServiceAccountKey")
  2654. // to unconditionally include in API requests. By default, fields with
  2655. // empty values are omitted from API requests. However, any non-pointer,
  2656. // non-interface field appearing in ForceSendFields will be sent to the
  2657. // server regardless of whether the field is empty or not. This may be
  2658. // used to include empty fields in Patch requests.
  2659. ForceSendFields []string `json:"-"`
  2660. // NullFields is a list of field names (e.g. "ServiceAccountKey") to
  2661. // include in API requests with the JSON null value. By default, fields
  2662. // with empty values are omitted from API requests. However, any field
  2663. // with an empty value appearing in NullFields will be sent to the
  2664. // server as null. It is an error if a field in this list has a
  2665. // non-empty value. This may be used to include null fields in Patch
  2666. // requests.
  2667. NullFields []string `json:"-"`
  2668. }
  2669. func (s *ServiceAccountKeysListResponse) MarshalJSON() ([]byte, error) {
  2670. type NoMethod ServiceAccountKeysListResponse
  2671. raw := NoMethod(*s)
  2672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2673. }
  2674. // SignupInfo: A resource returned by the GenerateSignupUrl API, which
  2675. // contains the Signup URL and Completion Token.
  2676. type SignupInfo struct {
  2677. // CompletionToken: An opaque token that will be required, along with
  2678. // the Enterprise Token, for obtaining the enterprise resource from
  2679. // CompleteSignup.
  2680. CompletionToken string `json:"completionToken,omitempty"`
  2681. // Kind: Identifies what kind of resource this is. Value: the fixed
  2682. // string "androidenterprise#signupInfo".
  2683. Kind string `json:"kind,omitempty"`
  2684. // Url: A URL under which the Admin can sign up for an enterprise. The
  2685. // page pointed to cannot be rendered in an iframe.
  2686. Url string `json:"url,omitempty"`
  2687. // ServerResponse contains the HTTP response code and headers from the
  2688. // server.
  2689. googleapi.ServerResponse `json:"-"`
  2690. // ForceSendFields is a list of field names (e.g. "CompletionToken") to
  2691. // unconditionally include in API requests. By default, fields with
  2692. // empty values are omitted from API requests. However, any non-pointer,
  2693. // non-interface field appearing in ForceSendFields will be sent to the
  2694. // server regardless of whether the field is empty or not. This may be
  2695. // used to include empty fields in Patch requests.
  2696. ForceSendFields []string `json:"-"`
  2697. // NullFields is a list of field names (e.g. "CompletionToken") to
  2698. // include in API requests with the JSON null value. By default, fields
  2699. // with empty values are omitted from API requests. However, any field
  2700. // with an empty value appearing in NullFields will be sent to the
  2701. // server as null. It is an error if a field in this list has a
  2702. // non-empty value. This may be used to include null fields in Patch
  2703. // requests.
  2704. NullFields []string `json:"-"`
  2705. }
  2706. func (s *SignupInfo) MarshalJSON() ([]byte, error) {
  2707. type NoMethod SignupInfo
  2708. raw := NoMethod(*s)
  2709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2710. }
  2711. // StoreCluster: Definition of a managed Google Play store cluster, a
  2712. // list of products displayed as part of a store page.
  2713. type StoreCluster struct {
  2714. // Id: Unique ID of this cluster. Assigned by the server. Immutable once
  2715. // assigned.
  2716. Id string `json:"id,omitempty"`
  2717. // Kind: Identifies what kind of resource this is. Value: the fixed
  2718. // string "androidenterprise#storeCluster".
  2719. Kind string `json:"kind,omitempty"`
  2720. // Name: Ordered list of localized strings giving the name of this page.
  2721. // The text displayed is the one that best matches the user locale, or
  2722. // the first entry if there is no good match. There needs to be at least
  2723. // one entry.
  2724. Name []*LocalizedText `json:"name,omitempty"`
  2725. // OrderInPage: String (US-ASCII only) used to determine order of this
  2726. // cluster within the parent page's elements. Page elements are sorted
  2727. // in lexicographic order of this field. Duplicated values are allowed,
  2728. // but ordering between elements with duplicate order is undefined.
  2729. //
  2730. // The value of this field is never visible to a user, it is used solely
  2731. // for the purpose of defining an ordering. Maximum length is 256
  2732. // characters.
  2733. OrderInPage string `json:"orderInPage,omitempty"`
  2734. // ProductId: List of products in the order they are displayed in the
  2735. // cluster. There should not be duplicates within a cluster.
  2736. ProductId []string `json:"productId,omitempty"`
  2737. // ServerResponse contains the HTTP response code and headers from the
  2738. // server.
  2739. googleapi.ServerResponse `json:"-"`
  2740. // ForceSendFields is a list of field names (e.g. "Id") to
  2741. // unconditionally include in API requests. By default, fields with
  2742. // empty values are omitted from API requests. However, any non-pointer,
  2743. // non-interface field appearing in ForceSendFields will be sent to the
  2744. // server regardless of whether the field is empty or not. This may be
  2745. // used to include empty fields in Patch requests.
  2746. ForceSendFields []string `json:"-"`
  2747. // NullFields is a list of field names (e.g. "Id") to include in API
  2748. // requests with the JSON null value. By default, fields with empty
  2749. // values are omitted from API requests. However, any field with an
  2750. // empty value appearing in NullFields will be sent to the server as
  2751. // null. It is an error if a field in this list has a non-empty value.
  2752. // This may be used to include null fields in Patch requests.
  2753. NullFields []string `json:"-"`
  2754. }
  2755. func (s *StoreCluster) MarshalJSON() ([]byte, error) {
  2756. type NoMethod StoreCluster
  2757. raw := NoMethod(*s)
  2758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2759. }
  2760. // StoreLayout: General setting for the managed Google Play store
  2761. // layout, currently only specifying the page to display the first time
  2762. // the store is opened.
  2763. type StoreLayout struct {
  2764. // HomepageId: The ID of the store page to be used as the homepage. The
  2765. // homepage is the first page shown in the managed Google Play
  2766. // Store.
  2767. //
  2768. // Not specifying a homepage is equivalent to setting the store layout
  2769. // type to "basic".
  2770. HomepageId string `json:"homepageId,omitempty"`
  2771. // Kind: Identifies what kind of resource this is. Value: the fixed
  2772. // string "androidenterprise#storeLayout".
  2773. Kind string `json:"kind,omitempty"`
  2774. // StoreLayoutType: The store layout type. By default, this value is set
  2775. // to "basic" if the homepageId field is not set, and to "custom"
  2776. // otherwise. If set to "basic", the layout will consist of all approved
  2777. // apps that have been whitelisted for the user.
  2778. StoreLayoutType string `json:"storeLayoutType,omitempty"`
  2779. // ServerResponse contains the HTTP response code and headers from the
  2780. // server.
  2781. googleapi.ServerResponse `json:"-"`
  2782. // ForceSendFields is a list of field names (e.g. "HomepageId") to
  2783. // unconditionally include in API requests. By default, fields with
  2784. // empty values are omitted from API requests. However, any non-pointer,
  2785. // non-interface field appearing in ForceSendFields will be sent to the
  2786. // server regardless of whether the field is empty or not. This may be
  2787. // used to include empty fields in Patch requests.
  2788. ForceSendFields []string `json:"-"`
  2789. // NullFields is a list of field names (e.g. "HomepageId") to include in
  2790. // API requests with the JSON null value. By default, fields with empty
  2791. // values are omitted from API requests. However, any field with an
  2792. // empty value appearing in NullFields will be sent to the server as
  2793. // null. It is an error if a field in this list has a non-empty value.
  2794. // This may be used to include null fields in Patch requests.
  2795. NullFields []string `json:"-"`
  2796. }
  2797. func (s *StoreLayout) MarshalJSON() ([]byte, error) {
  2798. type NoMethod StoreLayout
  2799. raw := NoMethod(*s)
  2800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2801. }
  2802. // StoreLayoutClustersListResponse: The store page resources for the
  2803. // enterprise.
  2804. type StoreLayoutClustersListResponse struct {
  2805. // Cluster: A store cluster of an enterprise.
  2806. Cluster []*StoreCluster `json:"cluster,omitempty"`
  2807. // Kind: Identifies what kind of resource this is. Value: the fixed
  2808. // string "androidenterprise#storeLayoutClustersListResponse".
  2809. Kind string `json:"kind,omitempty"`
  2810. // ServerResponse contains the HTTP response code and headers from the
  2811. // server.
  2812. googleapi.ServerResponse `json:"-"`
  2813. // ForceSendFields is a list of field names (e.g. "Cluster") to
  2814. // unconditionally include in API requests. By default, fields with
  2815. // empty values are omitted from API requests. However, any non-pointer,
  2816. // non-interface field appearing in ForceSendFields will be sent to the
  2817. // server regardless of whether the field is empty or not. This may be
  2818. // used to include empty fields in Patch requests.
  2819. ForceSendFields []string `json:"-"`
  2820. // NullFields is a list of field names (e.g. "Cluster") to include in
  2821. // API requests with the JSON null value. By default, fields with empty
  2822. // values are omitted from API requests. However, any field with an
  2823. // empty value appearing in NullFields will be sent to the server as
  2824. // null. It is an error if a field in this list has a non-empty value.
  2825. // This may be used to include null fields in Patch requests.
  2826. NullFields []string `json:"-"`
  2827. }
  2828. func (s *StoreLayoutClustersListResponse) MarshalJSON() ([]byte, error) {
  2829. type NoMethod StoreLayoutClustersListResponse
  2830. raw := NoMethod(*s)
  2831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2832. }
  2833. // StoreLayoutPagesListResponse: The store page resources for the
  2834. // enterprise.
  2835. type StoreLayoutPagesListResponse struct {
  2836. // Kind: Identifies what kind of resource this is. Value: the fixed
  2837. // string "androidenterprise#storeLayoutPagesListResponse".
  2838. Kind string `json:"kind,omitempty"`
  2839. // Page: A store page of an enterprise.
  2840. Page []*StorePage `json:"page,omitempty"`
  2841. // ServerResponse contains the HTTP response code and headers from the
  2842. // server.
  2843. googleapi.ServerResponse `json:"-"`
  2844. // ForceSendFields is a list of field names (e.g. "Kind") to
  2845. // unconditionally include in API requests. By default, fields with
  2846. // empty values are omitted from API requests. However, any non-pointer,
  2847. // non-interface field appearing in ForceSendFields will be sent to the
  2848. // server regardless of whether the field is empty or not. This may be
  2849. // used to include empty fields in Patch requests.
  2850. ForceSendFields []string `json:"-"`
  2851. // NullFields is a list of field names (e.g. "Kind") to include in API
  2852. // requests with the JSON null value. By default, fields with empty
  2853. // values are omitted from API requests. However, any field with an
  2854. // empty value appearing in NullFields will be sent to the server as
  2855. // null. It is an error if a field in this list has a non-empty value.
  2856. // This may be used to include null fields in Patch requests.
  2857. NullFields []string `json:"-"`
  2858. }
  2859. func (s *StoreLayoutPagesListResponse) MarshalJSON() ([]byte, error) {
  2860. type NoMethod StoreLayoutPagesListResponse
  2861. raw := NoMethod(*s)
  2862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2863. }
  2864. // StorePage: Definition of a managed Google Play store page, made of a
  2865. // localized name and links to other pages. A page also contains
  2866. // clusters defined as a subcollection.
  2867. type StorePage struct {
  2868. // Id: Unique ID of this page. Assigned by the server. Immutable once
  2869. // assigned.
  2870. Id string `json:"id,omitempty"`
  2871. // Kind: Identifies what kind of resource this is. Value: the fixed
  2872. // string "androidenterprise#storePage".
  2873. Kind string `json:"kind,omitempty"`
  2874. // Link: Ordered list of pages a user should be able to reach from this
  2875. // page. The list can't include this page. It is recommended that the
  2876. // basic pages are created first, before adding the links between
  2877. // pages.
  2878. //
  2879. // The API doesn't verify that the pages exist or the pages are
  2880. // reachable.
  2881. Link []string `json:"link,omitempty"`
  2882. // Name: Ordered list of localized strings giving the name of this page.
  2883. // The text displayed is the one that best matches the user locale, or
  2884. // the first entry if there is no good match. There needs to be at least
  2885. // one entry.
  2886. Name []*LocalizedText `json:"name,omitempty"`
  2887. // ServerResponse contains the HTTP response code and headers from the
  2888. // server.
  2889. googleapi.ServerResponse `json:"-"`
  2890. // ForceSendFields is a list of field names (e.g. "Id") to
  2891. // unconditionally include in API requests. By default, fields with
  2892. // empty values are omitted from API requests. However, any non-pointer,
  2893. // non-interface field appearing in ForceSendFields will be sent to the
  2894. // server regardless of whether the field is empty or not. This may be
  2895. // used to include empty fields in Patch requests.
  2896. ForceSendFields []string `json:"-"`
  2897. // NullFields is a list of field names (e.g. "Id") to include in API
  2898. // requests with the JSON null value. By default, fields with empty
  2899. // values are omitted from API requests. However, any field with an
  2900. // empty value appearing in NullFields will be sent to the server as
  2901. // null. It is an error if a field in this list has a non-empty value.
  2902. // This may be used to include null fields in Patch requests.
  2903. NullFields []string `json:"-"`
  2904. }
  2905. func (s *StorePage) MarshalJSON() ([]byte, error) {
  2906. type NoMethod StorePage
  2907. raw := NoMethod(*s)
  2908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2909. }
  2910. type TokenPagination struct {
  2911. NextPageToken string `json:"nextPageToken,omitempty"`
  2912. PreviousPageToken string `json:"previousPageToken,omitempty"`
  2913. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2914. // unconditionally include in API requests. By default, fields with
  2915. // empty values are omitted from API requests. However, any non-pointer,
  2916. // non-interface field appearing in ForceSendFields will be sent to the
  2917. // server regardless of whether the field is empty or not. This may be
  2918. // used to include empty fields in Patch requests.
  2919. ForceSendFields []string `json:"-"`
  2920. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2921. // in API requests with the JSON null value. By default, fields with
  2922. // empty values are omitted from API requests. However, any field with
  2923. // an empty value appearing in NullFields will be sent to the server as
  2924. // null. It is an error if a field in this list has a non-empty value.
  2925. // This may be used to include null fields in Patch requests.
  2926. NullFields []string `json:"-"`
  2927. }
  2928. func (s *TokenPagination) MarshalJSON() ([]byte, error) {
  2929. type NoMethod TokenPagination
  2930. raw := NoMethod(*s)
  2931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2932. }
  2933. // TrackInfo: Id to name association of a track.
  2934. type TrackInfo struct {
  2935. // TrackAlias: A modifiable name for a track. This is the visible name
  2936. // in the play developer console.
  2937. TrackAlias string `json:"trackAlias,omitempty"`
  2938. // TrackId: Unmodifiable, unique track identifier. This identifier is
  2939. // the releaseTrackId in the url of the play developer console page that
  2940. // displays the track information.
  2941. TrackId string `json:"trackId,omitempty"`
  2942. // ForceSendFields is a list of field names (e.g. "TrackAlias") to
  2943. // unconditionally include in API requests. By default, fields with
  2944. // empty values are omitted from API requests. However, any non-pointer,
  2945. // non-interface field appearing in ForceSendFields will be sent to the
  2946. // server regardless of whether the field is empty or not. This may be
  2947. // used to include empty fields in Patch requests.
  2948. ForceSendFields []string `json:"-"`
  2949. // NullFields is a list of field names (e.g. "TrackAlias") to include in
  2950. // API requests with the JSON null value. By default, fields with empty
  2951. // values are omitted from API requests. However, any field with an
  2952. // empty value appearing in NullFields will be sent to the server as
  2953. // null. It is an error if a field in this list has a non-empty value.
  2954. // This may be used to include null fields in Patch requests.
  2955. NullFields []string `json:"-"`
  2956. }
  2957. func (s *TrackInfo) MarshalJSON() ([]byte, error) {
  2958. type NoMethod TrackInfo
  2959. raw := NoMethod(*s)
  2960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2961. }
  2962. // User: A Users resource represents an account associated with an
  2963. // enterprise. The account may be specific to a device or to an
  2964. // individual user (who can then use the account across multiple
  2965. // devices). The account may provide access to managed Google Play only,
  2966. // or to other Google services, depending on the identity model:
  2967. // - The Google managed domain identity model requires synchronization
  2968. // to Google account sources (via primaryEmail).
  2969. // - The managed Google Play Accounts identity model provides a dynamic
  2970. // means for enterprises to create user or device accounts as needed.
  2971. // These accounts provide access to managed Google Play.
  2972. type User struct {
  2973. // AccountIdentifier: A unique identifier you create for this user, such
  2974. // as "user342" or "asset#44418". Do not use personally identifiable
  2975. // information (PII) for this property. Must always be set for
  2976. // EMM-managed users. Not set for Google-managed users.
  2977. AccountIdentifier string `json:"accountIdentifier,omitempty"`
  2978. // AccountType: The type of account that this user represents. A
  2979. // userAccount can be installed on multiple devices, but a deviceAccount
  2980. // is specific to a single device. An EMM-managed user (emmManaged) can
  2981. // be either type (userAccount, deviceAccount), but a Google-managed
  2982. // user (googleManaged) is always a userAccount.
  2983. AccountType string `json:"accountType,omitempty"`
  2984. // DisplayName: The name that will appear in user interfaces. Setting
  2985. // this property is optional when creating EMM-managed users. If you do
  2986. // set this property, use something generic about the organization (such
  2987. // as "Example, Inc.") or your name (as EMM). Not used for
  2988. // Google-managed user accounts.
  2989. DisplayName string `json:"displayName,omitempty"`
  2990. // Id: The unique ID for the user.
  2991. Id string `json:"id,omitempty"`
  2992. // Kind: Identifies what kind of resource this is. Value: the fixed
  2993. // string "androidenterprise#user".
  2994. Kind string `json:"kind,omitempty"`
  2995. // ManagementType: The entity that manages the user. With googleManaged
  2996. // users, the source of truth is Google so EMMs have to make sure a
  2997. // Google Account exists for the user. With emmManaged users, the EMM is
  2998. // in charge.
  2999. ManagementType string `json:"managementType,omitempty"`
  3000. // PrimaryEmail: The user's primary email address, for example,
  3001. // "jsmith@example.com". Will always be set for Google managed users and
  3002. // not set for EMM managed users.
  3003. PrimaryEmail string `json:"primaryEmail,omitempty"`
  3004. // ServerResponse contains the HTTP response code and headers from the
  3005. // server.
  3006. googleapi.ServerResponse `json:"-"`
  3007. // ForceSendFields is a list of field names (e.g. "AccountIdentifier")
  3008. // to unconditionally include in API requests. By default, fields with
  3009. // empty values are omitted from API requests. However, any non-pointer,
  3010. // non-interface field appearing in ForceSendFields will be sent to the
  3011. // server regardless of whether the field is empty or not. This may be
  3012. // used to include empty fields in Patch requests.
  3013. ForceSendFields []string `json:"-"`
  3014. // NullFields is a list of field names (e.g. "AccountIdentifier") to
  3015. // include in API requests with the JSON null value. By default, fields
  3016. // with empty values are omitted from API requests. However, any field
  3017. // with an empty value appearing in NullFields will be sent to the
  3018. // server as null. It is an error if a field in this list has a
  3019. // non-empty value. This may be used to include null fields in Patch
  3020. // requests.
  3021. NullFields []string `json:"-"`
  3022. }
  3023. func (s *User) MarshalJSON() ([]byte, error) {
  3024. type NoMethod User
  3025. raw := NoMethod(*s)
  3026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3027. }
  3028. // UserToken: A UserToken is used by a user when setting up a managed
  3029. // device or profile with their managed Google Play account on a device.
  3030. // When the user enters their email address and token (activation code)
  3031. // the appropriate EMM app can be automatically downloaded.
  3032. type UserToken struct {
  3033. // Kind: Identifies what kind of resource this is. Value: the fixed
  3034. // string "androidenterprise#userToken".
  3035. Kind string `json:"kind,omitempty"`
  3036. // Token: The token (activation code) to be entered by the user. This
  3037. // consists of a sequence of decimal digits. Note that the leading digit
  3038. // may be 0.
  3039. Token string `json:"token,omitempty"`
  3040. // UserId: The unique ID for the user.
  3041. UserId string `json:"userId,omitempty"`
  3042. // ServerResponse contains the HTTP response code and headers from the
  3043. // server.
  3044. googleapi.ServerResponse `json:"-"`
  3045. // ForceSendFields is a list of field names (e.g. "Kind") to
  3046. // unconditionally include in API requests. By default, fields with
  3047. // empty values are omitted from API requests. However, any non-pointer,
  3048. // non-interface field appearing in ForceSendFields will be sent to the
  3049. // server regardless of whether the field is empty or not. This may be
  3050. // used to include empty fields in Patch requests.
  3051. ForceSendFields []string `json:"-"`
  3052. // NullFields is a list of field names (e.g. "Kind") to include in API
  3053. // requests with the JSON null value. By default, fields with empty
  3054. // values are omitted from API requests. However, any field with an
  3055. // empty value appearing in NullFields will be sent to the server as
  3056. // null. It is an error if a field in this list has a non-empty value.
  3057. // This may be used to include null fields in Patch requests.
  3058. NullFields []string `json:"-"`
  3059. }
  3060. func (s *UserToken) MarshalJSON() ([]byte, error) {
  3061. type NoMethod UserToken
  3062. raw := NoMethod(*s)
  3063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3064. }
  3065. // UsersListResponse: The matching user resources.
  3066. type UsersListResponse struct {
  3067. // Kind: Identifies what kind of resource this is. Value: the fixed
  3068. // string "androidenterprise#usersListResponse".
  3069. Kind string `json:"kind,omitempty"`
  3070. // User: A user of an enterprise.
  3071. User []*User `json:"user,omitempty"`
  3072. // ServerResponse contains the HTTP response code and headers from the
  3073. // server.
  3074. googleapi.ServerResponse `json:"-"`
  3075. // ForceSendFields is a list of field names (e.g. "Kind") to
  3076. // unconditionally include in API requests. By default, fields with
  3077. // empty values are omitted from API requests. However, any non-pointer,
  3078. // non-interface field appearing in ForceSendFields will be sent to the
  3079. // server regardless of whether the field is empty or not. This may be
  3080. // used to include empty fields in Patch requests.
  3081. ForceSendFields []string `json:"-"`
  3082. // NullFields is a list of field names (e.g. "Kind") to include in API
  3083. // requests with the JSON null value. By default, fields with empty
  3084. // values are omitted from API requests. However, any field with an
  3085. // empty value appearing in NullFields will be sent to the server as
  3086. // null. It is an error if a field in this list has a non-empty value.
  3087. // This may be used to include null fields in Patch requests.
  3088. NullFields []string `json:"-"`
  3089. }
  3090. func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
  3091. type NoMethod UsersListResponse
  3092. raw := NoMethod(*s)
  3093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3094. }
  3095. // VariableSet: A variable set is a key-value pair of EMM-provided
  3096. // placeholders and its corresponding value, which is attributed to a
  3097. // user. For example, $FIRSTNAME could be a placeholder, and its value
  3098. // could be Alice. Placeholders should start with a '$' sign and should
  3099. // be alphanumeric only.
  3100. type VariableSet struct {
  3101. // Kind: Identifies what kind of resource this is. Value: the fixed
  3102. // string "androidenterprise#variableSet".
  3103. Kind string `json:"kind,omitempty"`
  3104. // Placeholder: The placeholder string; defined by EMM.
  3105. Placeholder string `json:"placeholder,omitempty"`
  3106. // UserValue: The value of the placeholder, specific to the user.
  3107. UserValue string `json:"userValue,omitempty"`
  3108. // ForceSendFields is a list of field names (e.g. "Kind") to
  3109. // unconditionally include in API requests. By default, fields with
  3110. // empty values are omitted from API requests. However, any non-pointer,
  3111. // non-interface field appearing in ForceSendFields will be sent to the
  3112. // server regardless of whether the field is empty or not. This may be
  3113. // used to include empty fields in Patch requests.
  3114. ForceSendFields []string `json:"-"`
  3115. // NullFields is a list of field names (e.g. "Kind") to include in API
  3116. // requests with the JSON null value. By default, fields with empty
  3117. // values are omitted from API requests. However, any field with an
  3118. // empty value appearing in NullFields will be sent to the server as
  3119. // null. It is an error if a field in this list has a non-empty value.
  3120. // This may be used to include null fields in Patch requests.
  3121. NullFields []string `json:"-"`
  3122. }
  3123. func (s *VariableSet) MarshalJSON() ([]byte, error) {
  3124. type NoMethod VariableSet
  3125. raw := NoMethod(*s)
  3126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3127. }
  3128. // WebApp: WebApp resource info.
  3129. type WebApp struct {
  3130. // DisplayMode: The display mode of the web app.
  3131. DisplayMode string `json:"displayMode,omitempty"`
  3132. // Icons: A list of icons representing this website. If absent, a
  3133. // default icon (for create) or the current icon (for update) will be
  3134. // used.
  3135. Icons []*WebAppIcon `json:"icons,omitempty"`
  3136. // IsPublished: A flag whether the app has been published to the Play
  3137. // store yet.
  3138. IsPublished bool `json:"isPublished,omitempty"`
  3139. // StartUrl: The start URL, i.e. the URL that should load when the user
  3140. // opens the application.
  3141. StartUrl string `json:"startUrl,omitempty"`
  3142. // Title: The title of the web application as displayed to the user
  3143. // (e.g., amongst a list of other applications, or as a label for an
  3144. // icon).
  3145. Title string `json:"title,omitempty"`
  3146. // VersionCode: The current version of the app.
  3147. //
  3148. //
  3149. // Note that the version can automatically increase during the lifetime
  3150. // of the web app, while Google does internal housekeeping to keep the
  3151. // web app up-to-date.
  3152. VersionCode int64 `json:"versionCode,omitempty,string"`
  3153. // WebAppId: The ID of the application.
  3154. WebAppId string `json:"webAppId,omitempty"`
  3155. // ServerResponse contains the HTTP response code and headers from the
  3156. // server.
  3157. googleapi.ServerResponse `json:"-"`
  3158. // ForceSendFields is a list of field names (e.g. "DisplayMode") to
  3159. // unconditionally include in API requests. By default, fields with
  3160. // empty values are omitted from API requests. However, any non-pointer,
  3161. // non-interface field appearing in ForceSendFields will be sent to the
  3162. // server regardless of whether the field is empty or not. This may be
  3163. // used to include empty fields in Patch requests.
  3164. ForceSendFields []string `json:"-"`
  3165. // NullFields is a list of field names (e.g. "DisplayMode") to include
  3166. // in API requests with the JSON null value. By default, fields with
  3167. // empty values are omitted from API requests. However, any field with
  3168. // an empty value appearing in NullFields will be sent to the server as
  3169. // null. It is an error if a field in this list has a non-empty value.
  3170. // This may be used to include null fields in Patch requests.
  3171. NullFields []string `json:"-"`
  3172. }
  3173. func (s *WebApp) MarshalJSON() ([]byte, error) {
  3174. type NoMethod WebApp
  3175. raw := NoMethod(*s)
  3176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3177. }
  3178. // WebAppIcon: Icon for a web app.
  3179. type WebAppIcon struct {
  3180. // ImageData: The actual bytes of the image in a base64url encoded
  3181. // string (c.f. RFC4648, section 5 "Base 64 Encoding with URL and
  3182. // Filename Safe Alphabet").
  3183. // - The image type can be png or jpg.
  3184. // - The image should ideally be square.
  3185. // - The image should ideally have a size of 512x512.
  3186. ImageData string `json:"imageData,omitempty"`
  3187. // ForceSendFields is a list of field names (e.g. "ImageData") to
  3188. // unconditionally include in API requests. By default, fields with
  3189. // empty values are omitted from API requests. However, any non-pointer,
  3190. // non-interface field appearing in ForceSendFields will be sent to the
  3191. // server regardless of whether the field is empty or not. This may be
  3192. // used to include empty fields in Patch requests.
  3193. ForceSendFields []string `json:"-"`
  3194. // NullFields is a list of field names (e.g. "ImageData") to include in
  3195. // API requests with the JSON null value. By default, fields with empty
  3196. // values are omitted from API requests. However, any field with an
  3197. // empty value appearing in NullFields will be sent to the server as
  3198. // null. It is an error if a field in this list has a non-empty value.
  3199. // This may be used to include null fields in Patch requests.
  3200. NullFields []string `json:"-"`
  3201. }
  3202. func (s *WebAppIcon) MarshalJSON() ([]byte, error) {
  3203. type NoMethod WebAppIcon
  3204. raw := NoMethod(*s)
  3205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3206. }
  3207. // WebAppsListResponse: The web app details for an enterprise.
  3208. type WebAppsListResponse struct {
  3209. // Kind: Identifies what kind of resource this is. Value: the fixed
  3210. // string "androidenterprise#webAppsListResponse".
  3211. Kind string `json:"kind,omitempty"`
  3212. // WebApp: The manifest describing a web app.
  3213. WebApp []*WebApp `json:"webApp,omitempty"`
  3214. // ServerResponse contains the HTTP response code and headers from the
  3215. // server.
  3216. googleapi.ServerResponse `json:"-"`
  3217. // ForceSendFields is a list of field names (e.g. "Kind") to
  3218. // unconditionally include in API requests. By default, fields with
  3219. // empty values are omitted from API requests. However, any non-pointer,
  3220. // non-interface field appearing in ForceSendFields will be sent to the
  3221. // server regardless of whether the field is empty or not. This may be
  3222. // used to include empty fields in Patch requests.
  3223. ForceSendFields []string `json:"-"`
  3224. // NullFields is a list of field names (e.g. "Kind") to include in API
  3225. // requests with the JSON null value. By default, fields with empty
  3226. // values are omitted from API requests. However, any field with an
  3227. // empty value appearing in NullFields will be sent to the server as
  3228. // null. It is an error if a field in this list has a non-empty value.
  3229. // This may be used to include null fields in Patch requests.
  3230. NullFields []string `json:"-"`
  3231. }
  3232. func (s *WebAppsListResponse) MarshalJSON() ([]byte, error) {
  3233. type NoMethod WebAppsListResponse
  3234. raw := NoMethod(*s)
  3235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3236. }
  3237. // method id "androidenterprise.devices.get":
  3238. type DevicesGetCall struct {
  3239. s *Service
  3240. enterpriseId string
  3241. userId string
  3242. deviceId string
  3243. urlParams_ gensupport.URLParams
  3244. ifNoneMatch_ string
  3245. ctx_ context.Context
  3246. header_ http.Header
  3247. }
  3248. // Get: Retrieves the details of a device.
  3249. func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall {
  3250. c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3251. c.enterpriseId = enterpriseId
  3252. c.userId = userId
  3253. c.deviceId = deviceId
  3254. return c
  3255. }
  3256. // Fields allows partial responses to be retrieved. See
  3257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3258. // for more information.
  3259. func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall {
  3260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3261. return c
  3262. }
  3263. // IfNoneMatch sets the optional parameter which makes the operation
  3264. // fail if the object's ETag matches the given value. This is useful for
  3265. // getting updates only after the object has changed since the last
  3266. // request. Use googleapi.IsNotModified to check whether the response
  3267. // error from Do is the result of In-None-Match.
  3268. func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall {
  3269. c.ifNoneMatch_ = entityTag
  3270. return c
  3271. }
  3272. // Context sets the context to be used in this call's Do method. Any
  3273. // pending HTTP request will be aborted if the provided context is
  3274. // canceled.
  3275. func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall {
  3276. c.ctx_ = ctx
  3277. return c
  3278. }
  3279. // Header returns an http.Header that can be modified by the caller to
  3280. // add HTTP headers to the request.
  3281. func (c *DevicesGetCall) Header() http.Header {
  3282. if c.header_ == nil {
  3283. c.header_ = make(http.Header)
  3284. }
  3285. return c.header_
  3286. }
  3287. func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) {
  3288. reqHeaders := make(http.Header)
  3289. for k, v := range c.header_ {
  3290. reqHeaders[k] = v
  3291. }
  3292. reqHeaders.Set("User-Agent", c.s.userAgent())
  3293. if c.ifNoneMatch_ != "" {
  3294. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3295. }
  3296. var body io.Reader = nil
  3297. c.urlParams_.Set("alt", alt)
  3298. c.urlParams_.Set("prettyPrint", "false")
  3299. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
  3300. urls += "?" + c.urlParams_.Encode()
  3301. req, err := http.NewRequest("GET", urls, body)
  3302. if err != nil {
  3303. return nil, err
  3304. }
  3305. req.Header = reqHeaders
  3306. googleapi.Expand(req.URL, map[string]string{
  3307. "enterpriseId": c.enterpriseId,
  3308. "userId": c.userId,
  3309. "deviceId": c.deviceId,
  3310. })
  3311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3312. }
  3313. // Do executes the "androidenterprise.devices.get" call.
  3314. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  3315. // code is an error. Response headers are in either
  3316. // *Device.ServerResponse.Header or (if a response was returned at all)
  3317. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3318. // check whether the returned error was because http.StatusNotModified
  3319. // was returned.
  3320. func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  3321. gensupport.SetOptions(c.urlParams_, opts...)
  3322. res, err := c.doRequest("json")
  3323. if res != nil && res.StatusCode == http.StatusNotModified {
  3324. if res.Body != nil {
  3325. res.Body.Close()
  3326. }
  3327. return nil, &googleapi.Error{
  3328. Code: res.StatusCode,
  3329. Header: res.Header,
  3330. }
  3331. }
  3332. if err != nil {
  3333. return nil, err
  3334. }
  3335. defer googleapi.CloseBody(res)
  3336. if err := googleapi.CheckResponse(res); err != nil {
  3337. return nil, err
  3338. }
  3339. ret := &Device{
  3340. ServerResponse: googleapi.ServerResponse{
  3341. Header: res.Header,
  3342. HTTPStatusCode: res.StatusCode,
  3343. },
  3344. }
  3345. target := &ret
  3346. if err := gensupport.DecodeResponse(target, res); err != nil {
  3347. return nil, err
  3348. }
  3349. return ret, nil
  3350. // {
  3351. // "description": "Retrieves the details of a device.",
  3352. // "httpMethod": "GET",
  3353. // "id": "androidenterprise.devices.get",
  3354. // "parameterOrder": [
  3355. // "enterpriseId",
  3356. // "userId",
  3357. // "deviceId"
  3358. // ],
  3359. // "parameters": {
  3360. // "deviceId": {
  3361. // "description": "The ID of the device.",
  3362. // "location": "path",
  3363. // "required": true,
  3364. // "type": "string"
  3365. // },
  3366. // "enterpriseId": {
  3367. // "description": "The ID of the enterprise.",
  3368. // "location": "path",
  3369. // "required": true,
  3370. // "type": "string"
  3371. // },
  3372. // "userId": {
  3373. // "description": "The ID of the user.",
  3374. // "location": "path",
  3375. // "required": true,
  3376. // "type": "string"
  3377. // }
  3378. // },
  3379. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
  3380. // "response": {
  3381. // "$ref": "Device"
  3382. // },
  3383. // "scopes": [
  3384. // "https://www.googleapis.com/auth/androidenterprise"
  3385. // ]
  3386. // }
  3387. }
  3388. // method id "androidenterprise.devices.getState":
  3389. type DevicesGetStateCall struct {
  3390. s *Service
  3391. enterpriseId string
  3392. userId string
  3393. deviceId string
  3394. urlParams_ gensupport.URLParams
  3395. ifNoneMatch_ string
  3396. ctx_ context.Context
  3397. header_ http.Header
  3398. }
  3399. // GetState: Retrieves whether a device's access to Google services is
  3400. // enabled or disabled. The device state takes effect only if enforcing
  3401. // EMM policies on Android devices is enabled in the Google Admin
  3402. // Console. Otherwise, the device state is ignored and all devices are
  3403. // allowed access to Google services. This is only supported for
  3404. // Google-managed users.
  3405. func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall {
  3406. c := &DevicesGetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3407. c.enterpriseId = enterpriseId
  3408. c.userId = userId
  3409. c.deviceId = deviceId
  3410. return c
  3411. }
  3412. // Fields allows partial responses to be retrieved. See
  3413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3414. // for more information.
  3415. func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall {
  3416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3417. return c
  3418. }
  3419. // IfNoneMatch sets the optional parameter which makes the operation
  3420. // fail if the object's ETag matches the given value. This is useful for
  3421. // getting updates only after the object has changed since the last
  3422. // request. Use googleapi.IsNotModified to check whether the response
  3423. // error from Do is the result of In-None-Match.
  3424. func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall {
  3425. c.ifNoneMatch_ = entityTag
  3426. return c
  3427. }
  3428. // Context sets the context to be used in this call's Do method. Any
  3429. // pending HTTP request will be aborted if the provided context is
  3430. // canceled.
  3431. func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall {
  3432. c.ctx_ = ctx
  3433. return c
  3434. }
  3435. // Header returns an http.Header that can be modified by the caller to
  3436. // add HTTP headers to the request.
  3437. func (c *DevicesGetStateCall) Header() http.Header {
  3438. if c.header_ == nil {
  3439. c.header_ = make(http.Header)
  3440. }
  3441. return c.header_
  3442. }
  3443. func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) {
  3444. reqHeaders := make(http.Header)
  3445. for k, v := range c.header_ {
  3446. reqHeaders[k] = v
  3447. }
  3448. reqHeaders.Set("User-Agent", c.s.userAgent())
  3449. if c.ifNoneMatch_ != "" {
  3450. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3451. }
  3452. var body io.Reader = nil
  3453. c.urlParams_.Set("alt", alt)
  3454. c.urlParams_.Set("prettyPrint", "false")
  3455. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
  3456. urls += "?" + c.urlParams_.Encode()
  3457. req, err := http.NewRequest("GET", urls, body)
  3458. if err != nil {
  3459. return nil, err
  3460. }
  3461. req.Header = reqHeaders
  3462. googleapi.Expand(req.URL, map[string]string{
  3463. "enterpriseId": c.enterpriseId,
  3464. "userId": c.userId,
  3465. "deviceId": c.deviceId,
  3466. })
  3467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3468. }
  3469. // Do executes the "androidenterprise.devices.getState" call.
  3470. // Exactly one of *DeviceState or error will be non-nil. Any non-2xx
  3471. // status code is an error. Response headers are in either
  3472. // *DeviceState.ServerResponse.Header or (if a response was returned at
  3473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3474. // to check whether the returned error was because
  3475. // http.StatusNotModified was returned.
  3476. func (c *DevicesGetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) {
  3477. gensupport.SetOptions(c.urlParams_, opts...)
  3478. res, err := c.doRequest("json")
  3479. if res != nil && res.StatusCode == http.StatusNotModified {
  3480. if res.Body != nil {
  3481. res.Body.Close()
  3482. }
  3483. return nil, &googleapi.Error{
  3484. Code: res.StatusCode,
  3485. Header: res.Header,
  3486. }
  3487. }
  3488. if err != nil {
  3489. return nil, err
  3490. }
  3491. defer googleapi.CloseBody(res)
  3492. if err := googleapi.CheckResponse(res); err != nil {
  3493. return nil, err
  3494. }
  3495. ret := &DeviceState{
  3496. ServerResponse: googleapi.ServerResponse{
  3497. Header: res.Header,
  3498. HTTPStatusCode: res.StatusCode,
  3499. },
  3500. }
  3501. target := &ret
  3502. if err := gensupport.DecodeResponse(target, res); err != nil {
  3503. return nil, err
  3504. }
  3505. return ret, nil
  3506. // {
  3507. // "description": "Retrieves whether a device's access to Google services is enabled or disabled. 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. This is only supported for Google-managed users.",
  3508. // "httpMethod": "GET",
  3509. // "id": "androidenterprise.devices.getState",
  3510. // "parameterOrder": [
  3511. // "enterpriseId",
  3512. // "userId",
  3513. // "deviceId"
  3514. // ],
  3515. // "parameters": {
  3516. // "deviceId": {
  3517. // "description": "The ID of the device.",
  3518. // "location": "path",
  3519. // "required": true,
  3520. // "type": "string"
  3521. // },
  3522. // "enterpriseId": {
  3523. // "description": "The ID of the enterprise.",
  3524. // "location": "path",
  3525. // "required": true,
  3526. // "type": "string"
  3527. // },
  3528. // "userId": {
  3529. // "description": "The ID of the user.",
  3530. // "location": "path",
  3531. // "required": true,
  3532. // "type": "string"
  3533. // }
  3534. // },
  3535. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
  3536. // "response": {
  3537. // "$ref": "DeviceState"
  3538. // },
  3539. // "scopes": [
  3540. // "https://www.googleapis.com/auth/androidenterprise"
  3541. // ]
  3542. // }
  3543. }
  3544. // method id "androidenterprise.devices.list":
  3545. type DevicesListCall struct {
  3546. s *Service
  3547. enterpriseId string
  3548. userId string
  3549. urlParams_ gensupport.URLParams
  3550. ifNoneMatch_ string
  3551. ctx_ context.Context
  3552. header_ http.Header
  3553. }
  3554. // List: Retrieves the IDs of all of a user's devices.
  3555. func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall {
  3556. c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3557. c.enterpriseId = enterpriseId
  3558. c.userId = userId
  3559. return c
  3560. }
  3561. // Fields allows partial responses to be retrieved. See
  3562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3563. // for more information.
  3564. func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall {
  3565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3566. return c
  3567. }
  3568. // IfNoneMatch sets the optional parameter which makes the operation
  3569. // fail if the object's ETag matches the given value. This is useful for
  3570. // getting updates only after the object has changed since the last
  3571. // request. Use googleapi.IsNotModified to check whether the response
  3572. // error from Do is the result of In-None-Match.
  3573. func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall {
  3574. c.ifNoneMatch_ = entityTag
  3575. return c
  3576. }
  3577. // Context sets the context to be used in this call's Do method. Any
  3578. // pending HTTP request will be aborted if the provided context is
  3579. // canceled.
  3580. func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall {
  3581. c.ctx_ = ctx
  3582. return c
  3583. }
  3584. // Header returns an http.Header that can be modified by the caller to
  3585. // add HTTP headers to the request.
  3586. func (c *DevicesListCall) Header() http.Header {
  3587. if c.header_ == nil {
  3588. c.header_ = make(http.Header)
  3589. }
  3590. return c.header_
  3591. }
  3592. func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) {
  3593. reqHeaders := make(http.Header)
  3594. for k, v := range c.header_ {
  3595. reqHeaders[k] = v
  3596. }
  3597. reqHeaders.Set("User-Agent", c.s.userAgent())
  3598. if c.ifNoneMatch_ != "" {
  3599. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3600. }
  3601. var body io.Reader = nil
  3602. c.urlParams_.Set("alt", alt)
  3603. c.urlParams_.Set("prettyPrint", "false")
  3604. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices")
  3605. urls += "?" + c.urlParams_.Encode()
  3606. req, err := http.NewRequest("GET", urls, body)
  3607. if err != nil {
  3608. return nil, err
  3609. }
  3610. req.Header = reqHeaders
  3611. googleapi.Expand(req.URL, map[string]string{
  3612. "enterpriseId": c.enterpriseId,
  3613. "userId": c.userId,
  3614. })
  3615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3616. }
  3617. // Do executes the "androidenterprise.devices.list" call.
  3618. // Exactly one of *DevicesListResponse or error will be non-nil. Any
  3619. // non-2xx status code is an error. Response headers are in either
  3620. // *DevicesListResponse.ServerResponse.Header or (if a response was
  3621. // returned at all) in error.(*googleapi.Error).Header. Use
  3622. // googleapi.IsNotModified to check whether the returned error was
  3623. // because http.StatusNotModified was returned.
  3624. func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*DevicesListResponse, error) {
  3625. gensupport.SetOptions(c.urlParams_, opts...)
  3626. res, err := c.doRequest("json")
  3627. if res != nil && res.StatusCode == http.StatusNotModified {
  3628. if res.Body != nil {
  3629. res.Body.Close()
  3630. }
  3631. return nil, &googleapi.Error{
  3632. Code: res.StatusCode,
  3633. Header: res.Header,
  3634. }
  3635. }
  3636. if err != nil {
  3637. return nil, err
  3638. }
  3639. defer googleapi.CloseBody(res)
  3640. if err := googleapi.CheckResponse(res); err != nil {
  3641. return nil, err
  3642. }
  3643. ret := &DevicesListResponse{
  3644. ServerResponse: googleapi.ServerResponse{
  3645. Header: res.Header,
  3646. HTTPStatusCode: res.StatusCode,
  3647. },
  3648. }
  3649. target := &ret
  3650. if err := gensupport.DecodeResponse(target, res); err != nil {
  3651. return nil, err
  3652. }
  3653. return ret, nil
  3654. // {
  3655. // "description": "Retrieves the IDs of all of a user's devices.",
  3656. // "httpMethod": "GET",
  3657. // "id": "androidenterprise.devices.list",
  3658. // "parameterOrder": [
  3659. // "enterpriseId",
  3660. // "userId"
  3661. // ],
  3662. // "parameters": {
  3663. // "enterpriseId": {
  3664. // "description": "The ID of the enterprise.",
  3665. // "location": "path",
  3666. // "required": true,
  3667. // "type": "string"
  3668. // },
  3669. // "userId": {
  3670. // "description": "The ID of the user.",
  3671. // "location": "path",
  3672. // "required": true,
  3673. // "type": "string"
  3674. // }
  3675. // },
  3676. // "path": "enterprises/{enterpriseId}/users/{userId}/devices",
  3677. // "response": {
  3678. // "$ref": "DevicesListResponse"
  3679. // },
  3680. // "scopes": [
  3681. // "https://www.googleapis.com/auth/androidenterprise"
  3682. // ]
  3683. // }
  3684. }
  3685. // method id "androidenterprise.devices.patch":
  3686. type DevicesPatchCall struct {
  3687. s *Service
  3688. enterpriseId string
  3689. userId string
  3690. deviceId string
  3691. device *Device
  3692. urlParams_ gensupport.URLParams
  3693. ctx_ context.Context
  3694. header_ http.Header
  3695. }
  3696. // Patch: Updates the device policy. This method supports patch
  3697. // semantics.
  3698. func (r *DevicesService) Patch(enterpriseId string, userId string, deviceId string, device *Device) *DevicesPatchCall {
  3699. c := &DevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3700. c.enterpriseId = enterpriseId
  3701. c.userId = userId
  3702. c.deviceId = deviceId
  3703. c.device = device
  3704. return c
  3705. }
  3706. // UpdateMask sets the optional parameter "updateMask": Mask that
  3707. // identifies which fields to update. If not set, all modifiable fields
  3708. // will be modified.
  3709. //
  3710. // When set in a query parameter, this field should be specified as
  3711. // updateMask=<field1>,<field2>,...
  3712. func (c *DevicesPatchCall) UpdateMask(updateMask string) *DevicesPatchCall {
  3713. c.urlParams_.Set("updateMask", updateMask)
  3714. return c
  3715. }
  3716. // Fields allows partial responses to be retrieved. See
  3717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3718. // for more information.
  3719. func (c *DevicesPatchCall) Fields(s ...googleapi.Field) *DevicesPatchCall {
  3720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3721. return c
  3722. }
  3723. // Context sets the context to be used in this call's Do method. Any
  3724. // pending HTTP request will be aborted if the provided context is
  3725. // canceled.
  3726. func (c *DevicesPatchCall) Context(ctx context.Context) *DevicesPatchCall {
  3727. c.ctx_ = ctx
  3728. return c
  3729. }
  3730. // Header returns an http.Header that can be modified by the caller to
  3731. // add HTTP headers to the request.
  3732. func (c *DevicesPatchCall) Header() http.Header {
  3733. if c.header_ == nil {
  3734. c.header_ = make(http.Header)
  3735. }
  3736. return c.header_
  3737. }
  3738. func (c *DevicesPatchCall) doRequest(alt string) (*http.Response, error) {
  3739. reqHeaders := make(http.Header)
  3740. for k, v := range c.header_ {
  3741. reqHeaders[k] = v
  3742. }
  3743. reqHeaders.Set("User-Agent", c.s.userAgent())
  3744. var body io.Reader = nil
  3745. body, err := googleapi.WithoutDataWrapper.JSONReader(c.device)
  3746. if err != nil {
  3747. return nil, err
  3748. }
  3749. reqHeaders.Set("Content-Type", "application/json")
  3750. c.urlParams_.Set("alt", alt)
  3751. c.urlParams_.Set("prettyPrint", "false")
  3752. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
  3753. urls += "?" + c.urlParams_.Encode()
  3754. req, err := http.NewRequest("PATCH", urls, body)
  3755. if err != nil {
  3756. return nil, err
  3757. }
  3758. req.Header = reqHeaders
  3759. googleapi.Expand(req.URL, map[string]string{
  3760. "enterpriseId": c.enterpriseId,
  3761. "userId": c.userId,
  3762. "deviceId": c.deviceId,
  3763. })
  3764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3765. }
  3766. // Do executes the "androidenterprise.devices.patch" call.
  3767. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  3768. // code is an error. Response headers are in either
  3769. // *Device.ServerResponse.Header or (if a response was returned at all)
  3770. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3771. // check whether the returned error was because http.StatusNotModified
  3772. // was returned.
  3773. func (c *DevicesPatchCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  3774. gensupport.SetOptions(c.urlParams_, opts...)
  3775. res, err := c.doRequest("json")
  3776. if res != nil && res.StatusCode == http.StatusNotModified {
  3777. if res.Body != nil {
  3778. res.Body.Close()
  3779. }
  3780. return nil, &googleapi.Error{
  3781. Code: res.StatusCode,
  3782. Header: res.Header,
  3783. }
  3784. }
  3785. if err != nil {
  3786. return nil, err
  3787. }
  3788. defer googleapi.CloseBody(res)
  3789. if err := googleapi.CheckResponse(res); err != nil {
  3790. return nil, err
  3791. }
  3792. ret := &Device{
  3793. ServerResponse: googleapi.ServerResponse{
  3794. Header: res.Header,
  3795. HTTPStatusCode: res.StatusCode,
  3796. },
  3797. }
  3798. target := &ret
  3799. if err := gensupport.DecodeResponse(target, res); err != nil {
  3800. return nil, err
  3801. }
  3802. return ret, nil
  3803. // {
  3804. // "description": "Updates the device policy. This method supports patch semantics.",
  3805. // "httpMethod": "PATCH",
  3806. // "id": "androidenterprise.devices.patch",
  3807. // "parameterOrder": [
  3808. // "enterpriseId",
  3809. // "userId",
  3810. // "deviceId"
  3811. // ],
  3812. // "parameters": {
  3813. // "deviceId": {
  3814. // "description": "The ID of the device.",
  3815. // "location": "path",
  3816. // "required": true,
  3817. // "type": "string"
  3818. // },
  3819. // "enterpriseId": {
  3820. // "description": "The ID of the enterprise.",
  3821. // "location": "path",
  3822. // "required": true,
  3823. // "type": "string"
  3824. // },
  3825. // "updateMask": {
  3826. // "description": "Mask that identifies which fields to update. If not set, all modifiable fields will be modified.\n\nWhen set in a query parameter, this field should be specified as updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...",
  3827. // "location": "query",
  3828. // "type": "string"
  3829. // },
  3830. // "userId": {
  3831. // "description": "The ID of the user.",
  3832. // "location": "path",
  3833. // "required": true,
  3834. // "type": "string"
  3835. // }
  3836. // },
  3837. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
  3838. // "request": {
  3839. // "$ref": "Device"
  3840. // },
  3841. // "response": {
  3842. // "$ref": "Device"
  3843. // },
  3844. // "scopes": [
  3845. // "https://www.googleapis.com/auth/androidenterprise"
  3846. // ]
  3847. // }
  3848. }
  3849. // method id "androidenterprise.devices.setState":
  3850. type DevicesSetStateCall struct {
  3851. s *Service
  3852. enterpriseId string
  3853. userId string
  3854. deviceId string
  3855. devicestate *DeviceState
  3856. urlParams_ gensupport.URLParams
  3857. ctx_ context.Context
  3858. header_ http.Header
  3859. }
  3860. // SetState: Sets whether a device's access to Google services is
  3861. // enabled or disabled. The device state takes effect only if enforcing
  3862. // EMM policies on Android devices is enabled in the Google Admin
  3863. // Console. Otherwise, the device state is ignored and all devices are
  3864. // allowed access to Google services. This is only supported for
  3865. // Google-managed users.
  3866. func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall {
  3867. c := &DevicesSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3868. c.enterpriseId = enterpriseId
  3869. c.userId = userId
  3870. c.deviceId = deviceId
  3871. c.devicestate = devicestate
  3872. return c
  3873. }
  3874. // Fields allows partial responses to be retrieved. See
  3875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3876. // for more information.
  3877. func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall {
  3878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3879. return c
  3880. }
  3881. // Context sets the context to be used in this call's Do method. Any
  3882. // pending HTTP request will be aborted if the provided context is
  3883. // canceled.
  3884. func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall {
  3885. c.ctx_ = ctx
  3886. return c
  3887. }
  3888. // Header returns an http.Header that can be modified by the caller to
  3889. // add HTTP headers to the request.
  3890. func (c *DevicesSetStateCall) Header() http.Header {
  3891. if c.header_ == nil {
  3892. c.header_ = make(http.Header)
  3893. }
  3894. return c.header_
  3895. }
  3896. func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) {
  3897. reqHeaders := make(http.Header)
  3898. for k, v := range c.header_ {
  3899. reqHeaders[k] = v
  3900. }
  3901. reqHeaders.Set("User-Agent", c.s.userAgent())
  3902. var body io.Reader = nil
  3903. body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate)
  3904. if err != nil {
  3905. return nil, err
  3906. }
  3907. reqHeaders.Set("Content-Type", "application/json")
  3908. c.urlParams_.Set("alt", alt)
  3909. c.urlParams_.Set("prettyPrint", "false")
  3910. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
  3911. urls += "?" + c.urlParams_.Encode()
  3912. req, err := http.NewRequest("PUT", urls, body)
  3913. if err != nil {
  3914. return nil, err
  3915. }
  3916. req.Header = reqHeaders
  3917. googleapi.Expand(req.URL, map[string]string{
  3918. "enterpriseId": c.enterpriseId,
  3919. "userId": c.userId,
  3920. "deviceId": c.deviceId,
  3921. })
  3922. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3923. }
  3924. // Do executes the "androidenterprise.devices.setState" call.
  3925. // Exactly one of *DeviceState or error will be non-nil. Any non-2xx
  3926. // status code is an error. Response headers are in either
  3927. // *DeviceState.ServerResponse.Header or (if a response was returned at
  3928. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3929. // to check whether the returned error was because
  3930. // http.StatusNotModified was returned.
  3931. func (c *DevicesSetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) {
  3932. gensupport.SetOptions(c.urlParams_, opts...)
  3933. res, err := c.doRequest("json")
  3934. if res != nil && res.StatusCode == http.StatusNotModified {
  3935. if res.Body != nil {
  3936. res.Body.Close()
  3937. }
  3938. return nil, &googleapi.Error{
  3939. Code: res.StatusCode,
  3940. Header: res.Header,
  3941. }
  3942. }
  3943. if err != nil {
  3944. return nil, err
  3945. }
  3946. defer googleapi.CloseBody(res)
  3947. if err := googleapi.CheckResponse(res); err != nil {
  3948. return nil, err
  3949. }
  3950. ret := &DeviceState{
  3951. ServerResponse: googleapi.ServerResponse{
  3952. Header: res.Header,
  3953. HTTPStatusCode: res.StatusCode,
  3954. },
  3955. }
  3956. target := &ret
  3957. if err := gensupport.DecodeResponse(target, res); err != nil {
  3958. return nil, err
  3959. }
  3960. return ret, nil
  3961. // {
  3962. // "description": "Sets whether a device's access to Google services is enabled or disabled. 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. This is only supported for Google-managed users.",
  3963. // "httpMethod": "PUT",
  3964. // "id": "androidenterprise.devices.setState",
  3965. // "parameterOrder": [
  3966. // "enterpriseId",
  3967. // "userId",
  3968. // "deviceId"
  3969. // ],
  3970. // "parameters": {
  3971. // "deviceId": {
  3972. // "description": "The ID of the device.",
  3973. // "location": "path",
  3974. // "required": true,
  3975. // "type": "string"
  3976. // },
  3977. // "enterpriseId": {
  3978. // "description": "The ID of the enterprise.",
  3979. // "location": "path",
  3980. // "required": true,
  3981. // "type": "string"
  3982. // },
  3983. // "userId": {
  3984. // "description": "The ID of the user.",
  3985. // "location": "path",
  3986. // "required": true,
  3987. // "type": "string"
  3988. // }
  3989. // },
  3990. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
  3991. // "request": {
  3992. // "$ref": "DeviceState"
  3993. // },
  3994. // "response": {
  3995. // "$ref": "DeviceState"
  3996. // },
  3997. // "scopes": [
  3998. // "https://www.googleapis.com/auth/androidenterprise"
  3999. // ]
  4000. // }
  4001. }
  4002. // method id "androidenterprise.devices.update":
  4003. type DevicesUpdateCall struct {
  4004. s *Service
  4005. enterpriseId string
  4006. userId string
  4007. deviceId string
  4008. device *Device
  4009. urlParams_ gensupport.URLParams
  4010. ctx_ context.Context
  4011. header_ http.Header
  4012. }
  4013. // Update: Updates the device policy
  4014. func (r *DevicesService) Update(enterpriseId string, userId string, deviceId string, device *Device) *DevicesUpdateCall {
  4015. c := &DevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4016. c.enterpriseId = enterpriseId
  4017. c.userId = userId
  4018. c.deviceId = deviceId
  4019. c.device = device
  4020. return c
  4021. }
  4022. // UpdateMask sets the optional parameter "updateMask": Mask that
  4023. // identifies which fields to update. If not set, all modifiable fields
  4024. // will be modified.
  4025. //
  4026. // When set in a query parameter, this field should be specified as
  4027. // updateMask=<field1>,<field2>,...
  4028. func (c *DevicesUpdateCall) UpdateMask(updateMask string) *DevicesUpdateCall {
  4029. c.urlParams_.Set("updateMask", updateMask)
  4030. return c
  4031. }
  4032. // Fields allows partial responses to be retrieved. See
  4033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4034. // for more information.
  4035. func (c *DevicesUpdateCall) Fields(s ...googleapi.Field) *DevicesUpdateCall {
  4036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4037. return c
  4038. }
  4039. // Context sets the context to be used in this call's Do method. Any
  4040. // pending HTTP request will be aborted if the provided context is
  4041. // canceled.
  4042. func (c *DevicesUpdateCall) Context(ctx context.Context) *DevicesUpdateCall {
  4043. c.ctx_ = ctx
  4044. return c
  4045. }
  4046. // Header returns an http.Header that can be modified by the caller to
  4047. // add HTTP headers to the request.
  4048. func (c *DevicesUpdateCall) Header() http.Header {
  4049. if c.header_ == nil {
  4050. c.header_ = make(http.Header)
  4051. }
  4052. return c.header_
  4053. }
  4054. func (c *DevicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  4055. reqHeaders := make(http.Header)
  4056. for k, v := range c.header_ {
  4057. reqHeaders[k] = v
  4058. }
  4059. reqHeaders.Set("User-Agent", c.s.userAgent())
  4060. var body io.Reader = nil
  4061. body, err := googleapi.WithoutDataWrapper.JSONReader(c.device)
  4062. if err != nil {
  4063. return nil, err
  4064. }
  4065. reqHeaders.Set("Content-Type", "application/json")
  4066. c.urlParams_.Set("alt", alt)
  4067. c.urlParams_.Set("prettyPrint", "false")
  4068. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
  4069. urls += "?" + c.urlParams_.Encode()
  4070. req, err := http.NewRequest("PUT", urls, body)
  4071. if err != nil {
  4072. return nil, err
  4073. }
  4074. req.Header = reqHeaders
  4075. googleapi.Expand(req.URL, map[string]string{
  4076. "enterpriseId": c.enterpriseId,
  4077. "userId": c.userId,
  4078. "deviceId": c.deviceId,
  4079. })
  4080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4081. }
  4082. // Do executes the "androidenterprise.devices.update" call.
  4083. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  4084. // code is an error. Response headers are in either
  4085. // *Device.ServerResponse.Header or (if a response was returned at all)
  4086. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4087. // check whether the returned error was because http.StatusNotModified
  4088. // was returned.
  4089. func (c *DevicesUpdateCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  4090. gensupport.SetOptions(c.urlParams_, opts...)
  4091. res, err := c.doRequest("json")
  4092. if res != nil && res.StatusCode == http.StatusNotModified {
  4093. if res.Body != nil {
  4094. res.Body.Close()
  4095. }
  4096. return nil, &googleapi.Error{
  4097. Code: res.StatusCode,
  4098. Header: res.Header,
  4099. }
  4100. }
  4101. if err != nil {
  4102. return nil, err
  4103. }
  4104. defer googleapi.CloseBody(res)
  4105. if err := googleapi.CheckResponse(res); err != nil {
  4106. return nil, err
  4107. }
  4108. ret := &Device{
  4109. ServerResponse: googleapi.ServerResponse{
  4110. Header: res.Header,
  4111. HTTPStatusCode: res.StatusCode,
  4112. },
  4113. }
  4114. target := &ret
  4115. if err := gensupport.DecodeResponse(target, res); err != nil {
  4116. return nil, err
  4117. }
  4118. return ret, nil
  4119. // {
  4120. // "description": "Updates the device policy",
  4121. // "httpMethod": "PUT",
  4122. // "id": "androidenterprise.devices.update",
  4123. // "parameterOrder": [
  4124. // "enterpriseId",
  4125. // "userId",
  4126. // "deviceId"
  4127. // ],
  4128. // "parameters": {
  4129. // "deviceId": {
  4130. // "description": "The ID of the device.",
  4131. // "location": "path",
  4132. // "required": true,
  4133. // "type": "string"
  4134. // },
  4135. // "enterpriseId": {
  4136. // "description": "The ID of the enterprise.",
  4137. // "location": "path",
  4138. // "required": true,
  4139. // "type": "string"
  4140. // },
  4141. // "updateMask": {
  4142. // "description": "Mask that identifies which fields to update. If not set, all modifiable fields will be modified.\n\nWhen set in a query parameter, this field should be specified as updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...",
  4143. // "location": "query",
  4144. // "type": "string"
  4145. // },
  4146. // "userId": {
  4147. // "description": "The ID of the user.",
  4148. // "location": "path",
  4149. // "required": true,
  4150. // "type": "string"
  4151. // }
  4152. // },
  4153. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
  4154. // "request": {
  4155. // "$ref": "Device"
  4156. // },
  4157. // "response": {
  4158. // "$ref": "Device"
  4159. // },
  4160. // "scopes": [
  4161. // "https://www.googleapis.com/auth/androidenterprise"
  4162. // ]
  4163. // }
  4164. }
  4165. // method id "androidenterprise.enterprises.acknowledgeNotificationSet":
  4166. type EnterprisesAcknowledgeNotificationSetCall struct {
  4167. s *Service
  4168. urlParams_ gensupport.URLParams
  4169. ctx_ context.Context
  4170. header_ http.Header
  4171. }
  4172. // AcknowledgeNotificationSet: Acknowledges notifications that were
  4173. // received from Enterprises.PullNotificationSet to prevent subsequent
  4174. // calls from returning the same notifications.
  4175. func (r *EnterprisesService) AcknowledgeNotificationSet() *EnterprisesAcknowledgeNotificationSetCall {
  4176. c := &EnterprisesAcknowledgeNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4177. return c
  4178. }
  4179. // NotificationSetId sets the optional parameter "notificationSetId":
  4180. // The notification set ID as returned by
  4181. // Enterprises.PullNotificationSet. This must be provided.
  4182. func (c *EnterprisesAcknowledgeNotificationSetCall) NotificationSetId(notificationSetId string) *EnterprisesAcknowledgeNotificationSetCall {
  4183. c.urlParams_.Set("notificationSetId", notificationSetId)
  4184. return c
  4185. }
  4186. // Fields allows partial responses to be retrieved. See
  4187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4188. // for more information.
  4189. func (c *EnterprisesAcknowledgeNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesAcknowledgeNotificationSetCall {
  4190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4191. return c
  4192. }
  4193. // Context sets the context to be used in this call's Do method. Any
  4194. // pending HTTP request will be aborted if the provided context is
  4195. // canceled.
  4196. func (c *EnterprisesAcknowledgeNotificationSetCall) Context(ctx context.Context) *EnterprisesAcknowledgeNotificationSetCall {
  4197. c.ctx_ = ctx
  4198. return c
  4199. }
  4200. // Header returns an http.Header that can be modified by the caller to
  4201. // add HTTP headers to the request.
  4202. func (c *EnterprisesAcknowledgeNotificationSetCall) Header() http.Header {
  4203. if c.header_ == nil {
  4204. c.header_ = make(http.Header)
  4205. }
  4206. return c.header_
  4207. }
  4208. func (c *EnterprisesAcknowledgeNotificationSetCall) doRequest(alt string) (*http.Response, error) {
  4209. reqHeaders := make(http.Header)
  4210. for k, v := range c.header_ {
  4211. reqHeaders[k] = v
  4212. }
  4213. reqHeaders.Set("User-Agent", c.s.userAgent())
  4214. var body io.Reader = nil
  4215. c.urlParams_.Set("alt", alt)
  4216. c.urlParams_.Set("prettyPrint", "false")
  4217. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/acknowledgeNotificationSet")
  4218. urls += "?" + c.urlParams_.Encode()
  4219. req, err := http.NewRequest("POST", urls, body)
  4220. if err != nil {
  4221. return nil, err
  4222. }
  4223. req.Header = reqHeaders
  4224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4225. }
  4226. // Do executes the "androidenterprise.enterprises.acknowledgeNotificationSet" call.
  4227. func (c *EnterprisesAcknowledgeNotificationSetCall) Do(opts ...googleapi.CallOption) error {
  4228. gensupport.SetOptions(c.urlParams_, opts...)
  4229. res, err := c.doRequest("json")
  4230. if err != nil {
  4231. return err
  4232. }
  4233. defer googleapi.CloseBody(res)
  4234. if err := googleapi.CheckResponse(res); err != nil {
  4235. return err
  4236. }
  4237. return nil
  4238. // {
  4239. // "description": "Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.",
  4240. // "httpMethod": "POST",
  4241. // "id": "androidenterprise.enterprises.acknowledgeNotificationSet",
  4242. // "parameters": {
  4243. // "notificationSetId": {
  4244. // "description": "The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided.",
  4245. // "location": "query",
  4246. // "type": "string"
  4247. // }
  4248. // },
  4249. // "path": "enterprises/acknowledgeNotificationSet",
  4250. // "scopes": [
  4251. // "https://www.googleapis.com/auth/androidenterprise"
  4252. // ]
  4253. // }
  4254. }
  4255. // method id "androidenterprise.enterprises.completeSignup":
  4256. type EnterprisesCompleteSignupCall struct {
  4257. s *Service
  4258. urlParams_ gensupport.URLParams
  4259. ctx_ context.Context
  4260. header_ http.Header
  4261. }
  4262. // CompleteSignup: Completes the signup flow, by specifying the
  4263. // Completion token and Enterprise token. This request must not be
  4264. // called multiple times for a given Enterprise Token.
  4265. func (r *EnterprisesService) CompleteSignup() *EnterprisesCompleteSignupCall {
  4266. c := &EnterprisesCompleteSignupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4267. return c
  4268. }
  4269. // CompletionToken sets the optional parameter "completionToken": The
  4270. // Completion token initially returned by GenerateSignupUrl.
  4271. func (c *EnterprisesCompleteSignupCall) CompletionToken(completionToken string) *EnterprisesCompleteSignupCall {
  4272. c.urlParams_.Set("completionToken", completionToken)
  4273. return c
  4274. }
  4275. // EnterpriseToken sets the optional parameter "enterpriseToken": The
  4276. // Enterprise token appended to the Callback URL.
  4277. func (c *EnterprisesCompleteSignupCall) EnterpriseToken(enterpriseToken string) *EnterprisesCompleteSignupCall {
  4278. c.urlParams_.Set("enterpriseToken", enterpriseToken)
  4279. return c
  4280. }
  4281. // Fields allows partial responses to be retrieved. See
  4282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4283. // for more information.
  4284. func (c *EnterprisesCompleteSignupCall) Fields(s ...googleapi.Field) *EnterprisesCompleteSignupCall {
  4285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4286. return c
  4287. }
  4288. // Context sets the context to be used in this call's Do method. Any
  4289. // pending HTTP request will be aborted if the provided context is
  4290. // canceled.
  4291. func (c *EnterprisesCompleteSignupCall) Context(ctx context.Context) *EnterprisesCompleteSignupCall {
  4292. c.ctx_ = ctx
  4293. return c
  4294. }
  4295. // Header returns an http.Header that can be modified by the caller to
  4296. // add HTTP headers to the request.
  4297. func (c *EnterprisesCompleteSignupCall) Header() http.Header {
  4298. if c.header_ == nil {
  4299. c.header_ = make(http.Header)
  4300. }
  4301. return c.header_
  4302. }
  4303. func (c *EnterprisesCompleteSignupCall) doRequest(alt string) (*http.Response, error) {
  4304. reqHeaders := make(http.Header)
  4305. for k, v := range c.header_ {
  4306. reqHeaders[k] = v
  4307. }
  4308. reqHeaders.Set("User-Agent", c.s.userAgent())
  4309. var body io.Reader = nil
  4310. c.urlParams_.Set("alt", alt)
  4311. c.urlParams_.Set("prettyPrint", "false")
  4312. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/completeSignup")
  4313. urls += "?" + c.urlParams_.Encode()
  4314. req, err := http.NewRequest("POST", urls, body)
  4315. if err != nil {
  4316. return nil, err
  4317. }
  4318. req.Header = reqHeaders
  4319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4320. }
  4321. // Do executes the "androidenterprise.enterprises.completeSignup" call.
  4322. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  4323. // status code is an error. Response headers are in either
  4324. // *Enterprise.ServerResponse.Header or (if a response was returned at
  4325. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4326. // to check whether the returned error was because
  4327. // http.StatusNotModified was returned.
  4328. func (c *EnterprisesCompleteSignupCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  4329. gensupport.SetOptions(c.urlParams_, opts...)
  4330. res, err := c.doRequest("json")
  4331. if res != nil && res.StatusCode == http.StatusNotModified {
  4332. if res.Body != nil {
  4333. res.Body.Close()
  4334. }
  4335. return nil, &googleapi.Error{
  4336. Code: res.StatusCode,
  4337. Header: res.Header,
  4338. }
  4339. }
  4340. if err != nil {
  4341. return nil, err
  4342. }
  4343. defer googleapi.CloseBody(res)
  4344. if err := googleapi.CheckResponse(res); err != nil {
  4345. return nil, err
  4346. }
  4347. ret := &Enterprise{
  4348. ServerResponse: googleapi.ServerResponse{
  4349. Header: res.Header,
  4350. HTTPStatusCode: res.StatusCode,
  4351. },
  4352. }
  4353. target := &ret
  4354. if err := gensupport.DecodeResponse(target, res); err != nil {
  4355. return nil, err
  4356. }
  4357. return ret, nil
  4358. // {
  4359. // "description": "Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token.",
  4360. // "httpMethod": "POST",
  4361. // "id": "androidenterprise.enterprises.completeSignup",
  4362. // "parameters": {
  4363. // "completionToken": {
  4364. // "description": "The Completion token initially returned by GenerateSignupUrl.",
  4365. // "location": "query",
  4366. // "type": "string"
  4367. // },
  4368. // "enterpriseToken": {
  4369. // "description": "The Enterprise token appended to the Callback URL.",
  4370. // "location": "query",
  4371. // "type": "string"
  4372. // }
  4373. // },
  4374. // "path": "enterprises/completeSignup",
  4375. // "response": {
  4376. // "$ref": "Enterprise"
  4377. // },
  4378. // "scopes": [
  4379. // "https://www.googleapis.com/auth/androidenterprise"
  4380. // ]
  4381. // }
  4382. }
  4383. // method id "androidenterprise.enterprises.createWebToken":
  4384. type EnterprisesCreateWebTokenCall struct {
  4385. s *Service
  4386. enterpriseId string
  4387. administratorwebtokenspec *AdministratorWebTokenSpec
  4388. urlParams_ gensupport.URLParams
  4389. ctx_ context.Context
  4390. header_ http.Header
  4391. }
  4392. // CreateWebToken: Returns a unique token to access an embeddable UI. To
  4393. // generate a web UI, pass the generated token into the managed Google
  4394. // Play javascript API. Each token may only be used to start one UI
  4395. // session. See the javascript API documentation for further
  4396. // information.
  4397. func (r *EnterprisesService) CreateWebToken(enterpriseId string, administratorwebtokenspec *AdministratorWebTokenSpec) *EnterprisesCreateWebTokenCall {
  4398. c := &EnterprisesCreateWebTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4399. c.enterpriseId = enterpriseId
  4400. c.administratorwebtokenspec = administratorwebtokenspec
  4401. return c
  4402. }
  4403. // Fields allows partial responses to be retrieved. See
  4404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4405. // for more information.
  4406. func (c *EnterprisesCreateWebTokenCall) Fields(s ...googleapi.Field) *EnterprisesCreateWebTokenCall {
  4407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4408. return c
  4409. }
  4410. // Context sets the context to be used in this call's Do method. Any
  4411. // pending HTTP request will be aborted if the provided context is
  4412. // canceled.
  4413. func (c *EnterprisesCreateWebTokenCall) Context(ctx context.Context) *EnterprisesCreateWebTokenCall {
  4414. c.ctx_ = ctx
  4415. return c
  4416. }
  4417. // Header returns an http.Header that can be modified by the caller to
  4418. // add HTTP headers to the request.
  4419. func (c *EnterprisesCreateWebTokenCall) Header() http.Header {
  4420. if c.header_ == nil {
  4421. c.header_ = make(http.Header)
  4422. }
  4423. return c.header_
  4424. }
  4425. func (c *EnterprisesCreateWebTokenCall) doRequest(alt string) (*http.Response, error) {
  4426. reqHeaders := make(http.Header)
  4427. for k, v := range c.header_ {
  4428. reqHeaders[k] = v
  4429. }
  4430. reqHeaders.Set("User-Agent", c.s.userAgent())
  4431. var body io.Reader = nil
  4432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.administratorwebtokenspec)
  4433. if err != nil {
  4434. return nil, err
  4435. }
  4436. reqHeaders.Set("Content-Type", "application/json")
  4437. c.urlParams_.Set("alt", alt)
  4438. c.urlParams_.Set("prettyPrint", "false")
  4439. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/createWebToken")
  4440. urls += "?" + c.urlParams_.Encode()
  4441. req, err := http.NewRequest("POST", urls, body)
  4442. if err != nil {
  4443. return nil, err
  4444. }
  4445. req.Header = reqHeaders
  4446. googleapi.Expand(req.URL, map[string]string{
  4447. "enterpriseId": c.enterpriseId,
  4448. })
  4449. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4450. }
  4451. // Do executes the "androidenterprise.enterprises.createWebToken" call.
  4452. // Exactly one of *AdministratorWebToken or error will be non-nil. Any
  4453. // non-2xx status code is an error. Response headers are in either
  4454. // *AdministratorWebToken.ServerResponse.Header or (if a response was
  4455. // returned at all) in error.(*googleapi.Error).Header. Use
  4456. // googleapi.IsNotModified to check whether the returned error was
  4457. // because http.StatusNotModified was returned.
  4458. func (c *EnterprisesCreateWebTokenCall) Do(opts ...googleapi.CallOption) (*AdministratorWebToken, error) {
  4459. gensupport.SetOptions(c.urlParams_, opts...)
  4460. res, err := c.doRequest("json")
  4461. if res != nil && res.StatusCode == http.StatusNotModified {
  4462. if res.Body != nil {
  4463. res.Body.Close()
  4464. }
  4465. return nil, &googleapi.Error{
  4466. Code: res.StatusCode,
  4467. Header: res.Header,
  4468. }
  4469. }
  4470. if err != nil {
  4471. return nil, err
  4472. }
  4473. defer googleapi.CloseBody(res)
  4474. if err := googleapi.CheckResponse(res); err != nil {
  4475. return nil, err
  4476. }
  4477. ret := &AdministratorWebToken{
  4478. ServerResponse: googleapi.ServerResponse{
  4479. Header: res.Header,
  4480. HTTPStatusCode: res.StatusCode,
  4481. },
  4482. }
  4483. target := &ret
  4484. if err := gensupport.DecodeResponse(target, res); err != nil {
  4485. return nil, err
  4486. }
  4487. return ret, nil
  4488. // {
  4489. // "description": "Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.",
  4490. // "httpMethod": "POST",
  4491. // "id": "androidenterprise.enterprises.createWebToken",
  4492. // "parameterOrder": [
  4493. // "enterpriseId"
  4494. // ],
  4495. // "parameters": {
  4496. // "enterpriseId": {
  4497. // "description": "The ID of the enterprise.",
  4498. // "location": "path",
  4499. // "required": true,
  4500. // "type": "string"
  4501. // }
  4502. // },
  4503. // "path": "enterprises/{enterpriseId}/createWebToken",
  4504. // "request": {
  4505. // "$ref": "AdministratorWebTokenSpec"
  4506. // },
  4507. // "response": {
  4508. // "$ref": "AdministratorWebToken"
  4509. // },
  4510. // "scopes": [
  4511. // "https://www.googleapis.com/auth/androidenterprise"
  4512. // ]
  4513. // }
  4514. }
  4515. // method id "androidenterprise.enterprises.enroll":
  4516. type EnterprisesEnrollCall struct {
  4517. s *Service
  4518. enterprise *Enterprise
  4519. urlParams_ gensupport.URLParams
  4520. ctx_ context.Context
  4521. header_ http.Header
  4522. }
  4523. // Enroll: Enrolls an enterprise with the calling EMM.
  4524. func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall {
  4525. c := &EnterprisesEnrollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4526. c.urlParams_.Set("token", token)
  4527. c.enterprise = enterprise
  4528. return c
  4529. }
  4530. // Fields allows partial responses to be retrieved. See
  4531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4532. // for more information.
  4533. func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall {
  4534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4535. return c
  4536. }
  4537. // Context sets the context to be used in this call's Do method. Any
  4538. // pending HTTP request will be aborted if the provided context is
  4539. // canceled.
  4540. func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall {
  4541. c.ctx_ = ctx
  4542. return c
  4543. }
  4544. // Header returns an http.Header that can be modified by the caller to
  4545. // add HTTP headers to the request.
  4546. func (c *EnterprisesEnrollCall) Header() http.Header {
  4547. if c.header_ == nil {
  4548. c.header_ = make(http.Header)
  4549. }
  4550. return c.header_
  4551. }
  4552. func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) {
  4553. reqHeaders := make(http.Header)
  4554. for k, v := range c.header_ {
  4555. reqHeaders[k] = v
  4556. }
  4557. reqHeaders.Set("User-Agent", c.s.userAgent())
  4558. var body io.Reader = nil
  4559. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
  4560. if err != nil {
  4561. return nil, err
  4562. }
  4563. reqHeaders.Set("Content-Type", "application/json")
  4564. c.urlParams_.Set("alt", alt)
  4565. c.urlParams_.Set("prettyPrint", "false")
  4566. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/enroll")
  4567. urls += "?" + c.urlParams_.Encode()
  4568. req, err := http.NewRequest("POST", urls, body)
  4569. if err != nil {
  4570. return nil, err
  4571. }
  4572. req.Header = reqHeaders
  4573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4574. }
  4575. // Do executes the "androidenterprise.enterprises.enroll" call.
  4576. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  4577. // status code is an error. Response headers are in either
  4578. // *Enterprise.ServerResponse.Header or (if a response was returned at
  4579. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4580. // to check whether the returned error was because
  4581. // http.StatusNotModified was returned.
  4582. func (c *EnterprisesEnrollCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  4583. gensupport.SetOptions(c.urlParams_, opts...)
  4584. res, err := c.doRequest("json")
  4585. if res != nil && res.StatusCode == http.StatusNotModified {
  4586. if res.Body != nil {
  4587. res.Body.Close()
  4588. }
  4589. return nil, &googleapi.Error{
  4590. Code: res.StatusCode,
  4591. Header: res.Header,
  4592. }
  4593. }
  4594. if err != nil {
  4595. return nil, err
  4596. }
  4597. defer googleapi.CloseBody(res)
  4598. if err := googleapi.CheckResponse(res); err != nil {
  4599. return nil, err
  4600. }
  4601. ret := &Enterprise{
  4602. ServerResponse: googleapi.ServerResponse{
  4603. Header: res.Header,
  4604. HTTPStatusCode: res.StatusCode,
  4605. },
  4606. }
  4607. target := &ret
  4608. if err := gensupport.DecodeResponse(target, res); err != nil {
  4609. return nil, err
  4610. }
  4611. return ret, nil
  4612. // {
  4613. // "description": "Enrolls an enterprise with the calling EMM.",
  4614. // "httpMethod": "POST",
  4615. // "id": "androidenterprise.enterprises.enroll",
  4616. // "parameterOrder": [
  4617. // "token"
  4618. // ],
  4619. // "parameters": {
  4620. // "token": {
  4621. // "description": "The token provided by the enterprise to register the EMM.",
  4622. // "location": "query",
  4623. // "required": true,
  4624. // "type": "string"
  4625. // }
  4626. // },
  4627. // "path": "enterprises/enroll",
  4628. // "request": {
  4629. // "$ref": "Enterprise"
  4630. // },
  4631. // "response": {
  4632. // "$ref": "Enterprise"
  4633. // },
  4634. // "scopes": [
  4635. // "https://www.googleapis.com/auth/androidenterprise"
  4636. // ]
  4637. // }
  4638. }
  4639. // method id "androidenterprise.enterprises.generateSignupUrl":
  4640. type EnterprisesGenerateSignupUrlCall struct {
  4641. s *Service
  4642. urlParams_ gensupport.URLParams
  4643. ctx_ context.Context
  4644. header_ http.Header
  4645. }
  4646. // GenerateSignupUrl: Generates a sign-up URL.
  4647. func (r *EnterprisesService) GenerateSignupUrl() *EnterprisesGenerateSignupUrlCall {
  4648. c := &EnterprisesGenerateSignupUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4649. return c
  4650. }
  4651. // CallbackUrl sets the optional parameter "callbackUrl": The callback
  4652. // URL to which the Admin will be redirected after successfully creating
  4653. // an enterprise. Before redirecting there the system will add a single
  4654. // query parameter to this URL named "enterpriseToken" which will
  4655. // contain an opaque token to be used for the CompleteSignup
  4656. // request.
  4657. // Beware that this means that the URL will be parsed, the parameter
  4658. // added and then a new URL formatted, i.e. there may be some minor
  4659. // formatting changes and, more importantly, the URL must be well-formed
  4660. // so that it can be parsed.
  4661. func (c *EnterprisesGenerateSignupUrlCall) CallbackUrl(callbackUrl string) *EnterprisesGenerateSignupUrlCall {
  4662. c.urlParams_.Set("callbackUrl", callbackUrl)
  4663. return c
  4664. }
  4665. // Fields allows partial responses to be retrieved. See
  4666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4667. // for more information.
  4668. func (c *EnterprisesGenerateSignupUrlCall) Fields(s ...googleapi.Field) *EnterprisesGenerateSignupUrlCall {
  4669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4670. return c
  4671. }
  4672. // Context sets the context to be used in this call's Do method. Any
  4673. // pending HTTP request will be aborted if the provided context is
  4674. // canceled.
  4675. func (c *EnterprisesGenerateSignupUrlCall) Context(ctx context.Context) *EnterprisesGenerateSignupUrlCall {
  4676. c.ctx_ = ctx
  4677. return c
  4678. }
  4679. // Header returns an http.Header that can be modified by the caller to
  4680. // add HTTP headers to the request.
  4681. func (c *EnterprisesGenerateSignupUrlCall) Header() http.Header {
  4682. if c.header_ == nil {
  4683. c.header_ = make(http.Header)
  4684. }
  4685. return c.header_
  4686. }
  4687. func (c *EnterprisesGenerateSignupUrlCall) doRequest(alt string) (*http.Response, error) {
  4688. reqHeaders := make(http.Header)
  4689. for k, v := range c.header_ {
  4690. reqHeaders[k] = v
  4691. }
  4692. reqHeaders.Set("User-Agent", c.s.userAgent())
  4693. var body io.Reader = nil
  4694. c.urlParams_.Set("alt", alt)
  4695. c.urlParams_.Set("prettyPrint", "false")
  4696. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/signupUrl")
  4697. urls += "?" + c.urlParams_.Encode()
  4698. req, err := http.NewRequest("POST", urls, body)
  4699. if err != nil {
  4700. return nil, err
  4701. }
  4702. req.Header = reqHeaders
  4703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4704. }
  4705. // Do executes the "androidenterprise.enterprises.generateSignupUrl" call.
  4706. // Exactly one of *SignupInfo or error will be non-nil. Any non-2xx
  4707. // status code is an error. Response headers are in either
  4708. // *SignupInfo.ServerResponse.Header or (if a response was returned at
  4709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4710. // to check whether the returned error was because
  4711. // http.StatusNotModified was returned.
  4712. func (c *EnterprisesGenerateSignupUrlCall) Do(opts ...googleapi.CallOption) (*SignupInfo, error) {
  4713. gensupport.SetOptions(c.urlParams_, opts...)
  4714. res, err := c.doRequest("json")
  4715. if res != nil && res.StatusCode == http.StatusNotModified {
  4716. if res.Body != nil {
  4717. res.Body.Close()
  4718. }
  4719. return nil, &googleapi.Error{
  4720. Code: res.StatusCode,
  4721. Header: res.Header,
  4722. }
  4723. }
  4724. if err != nil {
  4725. return nil, err
  4726. }
  4727. defer googleapi.CloseBody(res)
  4728. if err := googleapi.CheckResponse(res); err != nil {
  4729. return nil, err
  4730. }
  4731. ret := &SignupInfo{
  4732. ServerResponse: googleapi.ServerResponse{
  4733. Header: res.Header,
  4734. HTTPStatusCode: res.StatusCode,
  4735. },
  4736. }
  4737. target := &ret
  4738. if err := gensupport.DecodeResponse(target, res); err != nil {
  4739. return nil, err
  4740. }
  4741. return ret, nil
  4742. // {
  4743. // "description": "Generates a sign-up URL.",
  4744. // "httpMethod": "POST",
  4745. // "id": "androidenterprise.enterprises.generateSignupUrl",
  4746. // "parameters": {
  4747. // "callbackUrl": {
  4748. // "description": "The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named \"enterpriseToken\" which will contain an opaque token to be used for the CompleteSignup request.\nBeware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed.",
  4749. // "location": "query",
  4750. // "type": "string"
  4751. // }
  4752. // },
  4753. // "path": "enterprises/signupUrl",
  4754. // "response": {
  4755. // "$ref": "SignupInfo"
  4756. // },
  4757. // "scopes": [
  4758. // "https://www.googleapis.com/auth/androidenterprise"
  4759. // ]
  4760. // }
  4761. }
  4762. // method id "androidenterprise.enterprises.get":
  4763. type EnterprisesGetCall struct {
  4764. s *Service
  4765. enterpriseId string
  4766. urlParams_ gensupport.URLParams
  4767. ifNoneMatch_ string
  4768. ctx_ context.Context
  4769. header_ http.Header
  4770. }
  4771. // Get: Retrieves the name and domain of an enterprise.
  4772. func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall {
  4773. c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4774. c.enterpriseId = enterpriseId
  4775. return c
  4776. }
  4777. // Fields allows partial responses to be retrieved. See
  4778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4779. // for more information.
  4780. func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall {
  4781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4782. return c
  4783. }
  4784. // IfNoneMatch sets the optional parameter which makes the operation
  4785. // fail if the object's ETag matches the given value. This is useful for
  4786. // getting updates only after the object has changed since the last
  4787. // request. Use googleapi.IsNotModified to check whether the response
  4788. // error from Do is the result of In-None-Match.
  4789. func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall {
  4790. c.ifNoneMatch_ = entityTag
  4791. return c
  4792. }
  4793. // Context sets the context to be used in this call's Do method. Any
  4794. // pending HTTP request will be aborted if the provided context is
  4795. // canceled.
  4796. func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall {
  4797. c.ctx_ = ctx
  4798. return c
  4799. }
  4800. // Header returns an http.Header that can be modified by the caller to
  4801. // add HTTP headers to the request.
  4802. func (c *EnterprisesGetCall) Header() http.Header {
  4803. if c.header_ == nil {
  4804. c.header_ = make(http.Header)
  4805. }
  4806. return c.header_
  4807. }
  4808. func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) {
  4809. reqHeaders := make(http.Header)
  4810. for k, v := range c.header_ {
  4811. reqHeaders[k] = v
  4812. }
  4813. reqHeaders.Set("User-Agent", c.s.userAgent())
  4814. if c.ifNoneMatch_ != "" {
  4815. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4816. }
  4817. var body io.Reader = nil
  4818. c.urlParams_.Set("alt", alt)
  4819. c.urlParams_.Set("prettyPrint", "false")
  4820. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
  4821. urls += "?" + c.urlParams_.Encode()
  4822. req, err := http.NewRequest("GET", urls, body)
  4823. if err != nil {
  4824. return nil, err
  4825. }
  4826. req.Header = reqHeaders
  4827. googleapi.Expand(req.URL, map[string]string{
  4828. "enterpriseId": c.enterpriseId,
  4829. })
  4830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4831. }
  4832. // Do executes the "androidenterprise.enterprises.get" call.
  4833. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  4834. // status code is an error. Response headers are in either
  4835. // *Enterprise.ServerResponse.Header or (if a response was returned at
  4836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4837. // to check whether the returned error was because
  4838. // http.StatusNotModified was returned.
  4839. func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  4840. gensupport.SetOptions(c.urlParams_, opts...)
  4841. res, err := c.doRequest("json")
  4842. if res != nil && res.StatusCode == http.StatusNotModified {
  4843. if res.Body != nil {
  4844. res.Body.Close()
  4845. }
  4846. return nil, &googleapi.Error{
  4847. Code: res.StatusCode,
  4848. Header: res.Header,
  4849. }
  4850. }
  4851. if err != nil {
  4852. return nil, err
  4853. }
  4854. defer googleapi.CloseBody(res)
  4855. if err := googleapi.CheckResponse(res); err != nil {
  4856. return nil, err
  4857. }
  4858. ret := &Enterprise{
  4859. ServerResponse: googleapi.ServerResponse{
  4860. Header: res.Header,
  4861. HTTPStatusCode: res.StatusCode,
  4862. },
  4863. }
  4864. target := &ret
  4865. if err := gensupport.DecodeResponse(target, res); err != nil {
  4866. return nil, err
  4867. }
  4868. return ret, nil
  4869. // {
  4870. // "description": "Retrieves the name and domain of an enterprise.",
  4871. // "httpMethod": "GET",
  4872. // "id": "androidenterprise.enterprises.get",
  4873. // "parameterOrder": [
  4874. // "enterpriseId"
  4875. // ],
  4876. // "parameters": {
  4877. // "enterpriseId": {
  4878. // "description": "The ID of the enterprise.",
  4879. // "location": "path",
  4880. // "required": true,
  4881. // "type": "string"
  4882. // }
  4883. // },
  4884. // "path": "enterprises/{enterpriseId}",
  4885. // "response": {
  4886. // "$ref": "Enterprise"
  4887. // },
  4888. // "scopes": [
  4889. // "https://www.googleapis.com/auth/androidenterprise"
  4890. // ]
  4891. // }
  4892. }
  4893. // method id "androidenterprise.enterprises.getServiceAccount":
  4894. type EnterprisesGetServiceAccountCall struct {
  4895. s *Service
  4896. enterpriseId string
  4897. urlParams_ gensupport.URLParams
  4898. ifNoneMatch_ string
  4899. ctx_ context.Context
  4900. header_ http.Header
  4901. }
  4902. // GetServiceAccount: Returns a service account and credentials. The
  4903. // service account can be bound to the enterprise by calling setAccount.
  4904. // The service account is unique to this enterprise and EMM, and will be
  4905. // deleted if the enterprise is unbound. The credentials contain private
  4906. // key data and are not stored server-side.
  4907. //
  4908. // This method can only be called after calling Enterprises.Enroll or
  4909. // Enterprises.CompleteSignup, and before Enterprises.SetAccount; at
  4910. // other times it will return an error.
  4911. //
  4912. // Subsequent calls after the first will generate a new, unique set of
  4913. // credentials, and invalidate the previously generated
  4914. // credentials.
  4915. //
  4916. // Once the service account is bound to the enterprise, it can be
  4917. // managed using the serviceAccountKeys resource.
  4918. func (r *EnterprisesService) GetServiceAccount(enterpriseId string) *EnterprisesGetServiceAccountCall {
  4919. c := &EnterprisesGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4920. c.enterpriseId = enterpriseId
  4921. return c
  4922. }
  4923. // KeyType sets the optional parameter "keyType": The type of credential
  4924. // to return with the service account. Required.
  4925. //
  4926. // Possible values:
  4927. // "googleCredentials"
  4928. // "pkcs12"
  4929. func (c *EnterprisesGetServiceAccountCall) KeyType(keyType string) *EnterprisesGetServiceAccountCall {
  4930. c.urlParams_.Set("keyType", keyType)
  4931. return c
  4932. }
  4933. // Fields allows partial responses to be retrieved. See
  4934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4935. // for more information.
  4936. func (c *EnterprisesGetServiceAccountCall) Fields(s ...googleapi.Field) *EnterprisesGetServiceAccountCall {
  4937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4938. return c
  4939. }
  4940. // IfNoneMatch sets the optional parameter which makes the operation
  4941. // fail if the object's ETag matches the given value. This is useful for
  4942. // getting updates only after the object has changed since the last
  4943. // request. Use googleapi.IsNotModified to check whether the response
  4944. // error from Do is the result of In-None-Match.
  4945. func (c *EnterprisesGetServiceAccountCall) IfNoneMatch(entityTag string) *EnterprisesGetServiceAccountCall {
  4946. c.ifNoneMatch_ = entityTag
  4947. return c
  4948. }
  4949. // Context sets the context to be used in this call's Do method. Any
  4950. // pending HTTP request will be aborted if the provided context is
  4951. // canceled.
  4952. func (c *EnterprisesGetServiceAccountCall) Context(ctx context.Context) *EnterprisesGetServiceAccountCall {
  4953. c.ctx_ = ctx
  4954. return c
  4955. }
  4956. // Header returns an http.Header that can be modified by the caller to
  4957. // add HTTP headers to the request.
  4958. func (c *EnterprisesGetServiceAccountCall) Header() http.Header {
  4959. if c.header_ == nil {
  4960. c.header_ = make(http.Header)
  4961. }
  4962. return c.header_
  4963. }
  4964. func (c *EnterprisesGetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  4965. reqHeaders := make(http.Header)
  4966. for k, v := range c.header_ {
  4967. reqHeaders[k] = v
  4968. }
  4969. reqHeaders.Set("User-Agent", c.s.userAgent())
  4970. if c.ifNoneMatch_ != "" {
  4971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4972. }
  4973. var body io.Reader = nil
  4974. c.urlParams_.Set("alt", alt)
  4975. c.urlParams_.Set("prettyPrint", "false")
  4976. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccount")
  4977. urls += "?" + c.urlParams_.Encode()
  4978. req, err := http.NewRequest("GET", urls, body)
  4979. if err != nil {
  4980. return nil, err
  4981. }
  4982. req.Header = reqHeaders
  4983. googleapi.Expand(req.URL, map[string]string{
  4984. "enterpriseId": c.enterpriseId,
  4985. })
  4986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4987. }
  4988. // Do executes the "androidenterprise.enterprises.getServiceAccount" call.
  4989. // Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
  4990. // status code is an error. Response headers are in either
  4991. // *ServiceAccount.ServerResponse.Header or (if a response was returned
  4992. // at all) in error.(*googleapi.Error).Header. Use
  4993. // googleapi.IsNotModified to check whether the returned error was
  4994. // because http.StatusNotModified was returned.
  4995. func (c *EnterprisesGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
  4996. gensupport.SetOptions(c.urlParams_, opts...)
  4997. res, err := c.doRequest("json")
  4998. if res != nil && res.StatusCode == http.StatusNotModified {
  4999. if res.Body != nil {
  5000. res.Body.Close()
  5001. }
  5002. return nil, &googleapi.Error{
  5003. Code: res.StatusCode,
  5004. Header: res.Header,
  5005. }
  5006. }
  5007. if err != nil {
  5008. return nil, err
  5009. }
  5010. defer googleapi.CloseBody(res)
  5011. if err := googleapi.CheckResponse(res); err != nil {
  5012. return nil, err
  5013. }
  5014. ret := &ServiceAccount{
  5015. ServerResponse: googleapi.ServerResponse{
  5016. Header: res.Header,
  5017. HTTPStatusCode: res.StatusCode,
  5018. },
  5019. }
  5020. target := &ret
  5021. if err := gensupport.DecodeResponse(target, res); err != nil {
  5022. return nil, err
  5023. }
  5024. return ret, nil
  5025. // {
  5026. // "description": "Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side.\n\nThis method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error.\n\nSubsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials.\n\nOnce the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource.",
  5027. // "httpMethod": "GET",
  5028. // "id": "androidenterprise.enterprises.getServiceAccount",
  5029. // "parameterOrder": [
  5030. // "enterpriseId"
  5031. // ],
  5032. // "parameters": {
  5033. // "enterpriseId": {
  5034. // "description": "The ID of the enterprise.",
  5035. // "location": "path",
  5036. // "required": true,
  5037. // "type": "string"
  5038. // },
  5039. // "keyType": {
  5040. // "description": "The type of credential to return with the service account. Required.",
  5041. // "enum": [
  5042. // "googleCredentials",
  5043. // "pkcs12"
  5044. // ],
  5045. // "enumDescriptions": [
  5046. // "",
  5047. // ""
  5048. // ],
  5049. // "location": "query",
  5050. // "type": "string"
  5051. // }
  5052. // },
  5053. // "path": "enterprises/{enterpriseId}/serviceAccount",
  5054. // "response": {
  5055. // "$ref": "ServiceAccount"
  5056. // },
  5057. // "scopes": [
  5058. // "https://www.googleapis.com/auth/androidenterprise"
  5059. // ]
  5060. // }
  5061. }
  5062. // method id "androidenterprise.enterprises.getStoreLayout":
  5063. type EnterprisesGetStoreLayoutCall struct {
  5064. s *Service
  5065. enterpriseId string
  5066. urlParams_ gensupport.URLParams
  5067. ifNoneMatch_ string
  5068. ctx_ context.Context
  5069. header_ http.Header
  5070. }
  5071. // GetStoreLayout: Returns the store layout for the enterprise. If the
  5072. // store layout has not been set, returns "basic" as the store layout
  5073. // type and no homepage.
  5074. func (r *EnterprisesService) GetStoreLayout(enterpriseId string) *EnterprisesGetStoreLayoutCall {
  5075. c := &EnterprisesGetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5076. c.enterpriseId = enterpriseId
  5077. return c
  5078. }
  5079. // Fields allows partial responses to be retrieved. See
  5080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5081. // for more information.
  5082. func (c *EnterprisesGetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesGetStoreLayoutCall {
  5083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5084. return c
  5085. }
  5086. // IfNoneMatch sets the optional parameter which makes the operation
  5087. // fail if the object's ETag matches the given value. This is useful for
  5088. // getting updates only after the object has changed since the last
  5089. // request. Use googleapi.IsNotModified to check whether the response
  5090. // error from Do is the result of In-None-Match.
  5091. func (c *EnterprisesGetStoreLayoutCall) IfNoneMatch(entityTag string) *EnterprisesGetStoreLayoutCall {
  5092. c.ifNoneMatch_ = entityTag
  5093. return c
  5094. }
  5095. // Context sets the context to be used in this call's Do method. Any
  5096. // pending HTTP request will be aborted if the provided context is
  5097. // canceled.
  5098. func (c *EnterprisesGetStoreLayoutCall) Context(ctx context.Context) *EnterprisesGetStoreLayoutCall {
  5099. c.ctx_ = ctx
  5100. return c
  5101. }
  5102. // Header returns an http.Header that can be modified by the caller to
  5103. // add HTTP headers to the request.
  5104. func (c *EnterprisesGetStoreLayoutCall) Header() http.Header {
  5105. if c.header_ == nil {
  5106. c.header_ = make(http.Header)
  5107. }
  5108. return c.header_
  5109. }
  5110. func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, error) {
  5111. reqHeaders := make(http.Header)
  5112. for k, v := range c.header_ {
  5113. reqHeaders[k] = v
  5114. }
  5115. reqHeaders.Set("User-Agent", c.s.userAgent())
  5116. if c.ifNoneMatch_ != "" {
  5117. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5118. }
  5119. var body io.Reader = nil
  5120. c.urlParams_.Set("alt", alt)
  5121. c.urlParams_.Set("prettyPrint", "false")
  5122. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout")
  5123. urls += "?" + c.urlParams_.Encode()
  5124. req, err := http.NewRequest("GET", urls, body)
  5125. if err != nil {
  5126. return nil, err
  5127. }
  5128. req.Header = reqHeaders
  5129. googleapi.Expand(req.URL, map[string]string{
  5130. "enterpriseId": c.enterpriseId,
  5131. })
  5132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5133. }
  5134. // Do executes the "androidenterprise.enterprises.getStoreLayout" call.
  5135. // Exactly one of *StoreLayout or error will be non-nil. Any non-2xx
  5136. // status code is an error. Response headers are in either
  5137. // *StoreLayout.ServerResponse.Header or (if a response was returned at
  5138. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5139. // to check whether the returned error was because
  5140. // http.StatusNotModified was returned.
  5141. func (c *EnterprisesGetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) {
  5142. gensupport.SetOptions(c.urlParams_, opts...)
  5143. res, err := c.doRequest("json")
  5144. if res != nil && res.StatusCode == http.StatusNotModified {
  5145. if res.Body != nil {
  5146. res.Body.Close()
  5147. }
  5148. return nil, &googleapi.Error{
  5149. Code: res.StatusCode,
  5150. Header: res.Header,
  5151. }
  5152. }
  5153. if err != nil {
  5154. return nil, err
  5155. }
  5156. defer googleapi.CloseBody(res)
  5157. if err := googleapi.CheckResponse(res); err != nil {
  5158. return nil, err
  5159. }
  5160. ret := &StoreLayout{
  5161. ServerResponse: googleapi.ServerResponse{
  5162. Header: res.Header,
  5163. HTTPStatusCode: res.StatusCode,
  5164. },
  5165. }
  5166. target := &ret
  5167. if err := gensupport.DecodeResponse(target, res); err != nil {
  5168. return nil, err
  5169. }
  5170. return ret, nil
  5171. // {
  5172. // "description": "Returns the store layout for the enterprise. If the store layout has not been set, returns \"basic\" as the store layout type and no homepage.",
  5173. // "httpMethod": "GET",
  5174. // "id": "androidenterprise.enterprises.getStoreLayout",
  5175. // "parameterOrder": [
  5176. // "enterpriseId"
  5177. // ],
  5178. // "parameters": {
  5179. // "enterpriseId": {
  5180. // "description": "The ID of the enterprise.",
  5181. // "location": "path",
  5182. // "required": true,
  5183. // "type": "string"
  5184. // }
  5185. // },
  5186. // "path": "enterprises/{enterpriseId}/storeLayout",
  5187. // "response": {
  5188. // "$ref": "StoreLayout"
  5189. // },
  5190. // "scopes": [
  5191. // "https://www.googleapis.com/auth/androidenterprise"
  5192. // ]
  5193. // }
  5194. }
  5195. // method id "androidenterprise.enterprises.list":
  5196. type EnterprisesListCall struct {
  5197. s *Service
  5198. urlParams_ gensupport.URLParams
  5199. ifNoneMatch_ string
  5200. ctx_ context.Context
  5201. header_ http.Header
  5202. }
  5203. // List: Looks up an enterprise by domain name. This is only supported
  5204. // for enterprises created via the Google-initiated creation flow.
  5205. // Lookup of the id is not needed for enterprises created via the
  5206. // EMM-initiated flow since the EMM learns the enterprise ID in the
  5207. // callback specified in the Enterprises.generateSignupUrl call.
  5208. func (r *EnterprisesService) List(domain string) *EnterprisesListCall {
  5209. c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5210. c.urlParams_.Set("domain", domain)
  5211. return c
  5212. }
  5213. // Fields allows partial responses to be retrieved. See
  5214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5215. // for more information.
  5216. func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall {
  5217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5218. return c
  5219. }
  5220. // IfNoneMatch sets the optional parameter which makes the operation
  5221. // fail if the object's ETag matches the given value. This is useful for
  5222. // getting updates only after the object has changed since the last
  5223. // request. Use googleapi.IsNotModified to check whether the response
  5224. // error from Do is the result of In-None-Match.
  5225. func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall {
  5226. c.ifNoneMatch_ = entityTag
  5227. return c
  5228. }
  5229. // Context sets the context to be used in this call's Do method. Any
  5230. // pending HTTP request will be aborted if the provided context is
  5231. // canceled.
  5232. func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall {
  5233. c.ctx_ = ctx
  5234. return c
  5235. }
  5236. // Header returns an http.Header that can be modified by the caller to
  5237. // add HTTP headers to the request.
  5238. func (c *EnterprisesListCall) Header() http.Header {
  5239. if c.header_ == nil {
  5240. c.header_ = make(http.Header)
  5241. }
  5242. return c.header_
  5243. }
  5244. func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) {
  5245. reqHeaders := make(http.Header)
  5246. for k, v := range c.header_ {
  5247. reqHeaders[k] = v
  5248. }
  5249. reqHeaders.Set("User-Agent", c.s.userAgent())
  5250. if c.ifNoneMatch_ != "" {
  5251. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5252. }
  5253. var body io.Reader = nil
  5254. c.urlParams_.Set("alt", alt)
  5255. c.urlParams_.Set("prettyPrint", "false")
  5256. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
  5257. urls += "?" + c.urlParams_.Encode()
  5258. req, err := http.NewRequest("GET", urls, body)
  5259. if err != nil {
  5260. return nil, err
  5261. }
  5262. req.Header = reqHeaders
  5263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5264. }
  5265. // Do executes the "androidenterprise.enterprises.list" call.
  5266. // Exactly one of *EnterprisesListResponse or error will be non-nil. Any
  5267. // non-2xx status code is an error. Response headers are in either
  5268. // *EnterprisesListResponse.ServerResponse.Header or (if a response was
  5269. // returned at all) in error.(*googleapi.Error).Header. Use
  5270. // googleapi.IsNotModified to check whether the returned error was
  5271. // because http.StatusNotModified was returned.
  5272. func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*EnterprisesListResponse, error) {
  5273. gensupport.SetOptions(c.urlParams_, opts...)
  5274. res, err := c.doRequest("json")
  5275. if res != nil && res.StatusCode == http.StatusNotModified {
  5276. if res.Body != nil {
  5277. res.Body.Close()
  5278. }
  5279. return nil, &googleapi.Error{
  5280. Code: res.StatusCode,
  5281. Header: res.Header,
  5282. }
  5283. }
  5284. if err != nil {
  5285. return nil, err
  5286. }
  5287. defer googleapi.CloseBody(res)
  5288. if err := googleapi.CheckResponse(res); err != nil {
  5289. return nil, err
  5290. }
  5291. ret := &EnterprisesListResponse{
  5292. ServerResponse: googleapi.ServerResponse{
  5293. Header: res.Header,
  5294. HTTPStatusCode: res.StatusCode,
  5295. },
  5296. }
  5297. target := &ret
  5298. if err := gensupport.DecodeResponse(target, res); err != nil {
  5299. return nil, err
  5300. }
  5301. return ret, nil
  5302. // {
  5303. // "description": "Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call.",
  5304. // "httpMethod": "GET",
  5305. // "id": "androidenterprise.enterprises.list",
  5306. // "parameterOrder": [
  5307. // "domain"
  5308. // ],
  5309. // "parameters": {
  5310. // "domain": {
  5311. // "description": "The exact primary domain name of the enterprise to look up.",
  5312. // "location": "query",
  5313. // "required": true,
  5314. // "type": "string"
  5315. // }
  5316. // },
  5317. // "path": "enterprises",
  5318. // "response": {
  5319. // "$ref": "EnterprisesListResponse"
  5320. // },
  5321. // "scopes": [
  5322. // "https://www.googleapis.com/auth/androidenterprise"
  5323. // ]
  5324. // }
  5325. }
  5326. // method id "androidenterprise.enterprises.pullNotificationSet":
  5327. type EnterprisesPullNotificationSetCall struct {
  5328. s *Service
  5329. urlParams_ gensupport.URLParams
  5330. ctx_ context.Context
  5331. header_ http.Header
  5332. }
  5333. // PullNotificationSet: Pulls and returns a notification set for the
  5334. // enterprises associated with the service account authenticated for the
  5335. // request. The notification set may be empty if no notification are
  5336. // pending.
  5337. // A notification set returned needs to be acknowledged within 20
  5338. // seconds by calling Enterprises.AcknowledgeNotificationSet, unless the
  5339. // notification set is empty.
  5340. // Notifications that are not acknowledged within the 20 seconds will
  5341. // eventually be included again in the response to another
  5342. // PullNotificationSet request, and those that are never acknowledged
  5343. // will ultimately be deleted according to the Google Cloud Platform
  5344. // Pub/Sub system policy.
  5345. // Multiple requests might be performed concurrently to retrieve
  5346. // notifications, in which case the pending notifications (if any) will
  5347. // be split among each caller, if any are pending.
  5348. // If no notifications are present, an empty notification list is
  5349. // returned. Subsequent requests may return more notifications once they
  5350. // become available.
  5351. func (r *EnterprisesService) PullNotificationSet() *EnterprisesPullNotificationSetCall {
  5352. c := &EnterprisesPullNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5353. return c
  5354. }
  5355. // RequestMode sets the optional parameter "requestMode": The request
  5356. // mode for pulling notifications.
  5357. // Specifying waitForNotifications will cause the request to block and
  5358. // wait until one or more notifications are present, or return an empty
  5359. // notification list if no notifications are present after some
  5360. // time.
  5361. // Speciying returnImmediately will cause the request to immediately
  5362. // return the pending notifications, or an empty list if no
  5363. // notifications are present.
  5364. // If omitted, defaults to waitForNotifications.
  5365. //
  5366. // Possible values:
  5367. // "returnImmediately"
  5368. // "waitForNotifications"
  5369. func (c *EnterprisesPullNotificationSetCall) RequestMode(requestMode string) *EnterprisesPullNotificationSetCall {
  5370. c.urlParams_.Set("requestMode", requestMode)
  5371. return c
  5372. }
  5373. // Fields allows partial responses to be retrieved. See
  5374. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5375. // for more information.
  5376. func (c *EnterprisesPullNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesPullNotificationSetCall {
  5377. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5378. return c
  5379. }
  5380. // Context sets the context to be used in this call's Do method. Any
  5381. // pending HTTP request will be aborted if the provided context is
  5382. // canceled.
  5383. func (c *EnterprisesPullNotificationSetCall) Context(ctx context.Context) *EnterprisesPullNotificationSetCall {
  5384. c.ctx_ = ctx
  5385. return c
  5386. }
  5387. // Header returns an http.Header that can be modified by the caller to
  5388. // add HTTP headers to the request.
  5389. func (c *EnterprisesPullNotificationSetCall) Header() http.Header {
  5390. if c.header_ == nil {
  5391. c.header_ = make(http.Header)
  5392. }
  5393. return c.header_
  5394. }
  5395. func (c *EnterprisesPullNotificationSetCall) doRequest(alt string) (*http.Response, error) {
  5396. reqHeaders := make(http.Header)
  5397. for k, v := range c.header_ {
  5398. reqHeaders[k] = v
  5399. }
  5400. reqHeaders.Set("User-Agent", c.s.userAgent())
  5401. var body io.Reader = nil
  5402. c.urlParams_.Set("alt", alt)
  5403. c.urlParams_.Set("prettyPrint", "false")
  5404. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/pullNotificationSet")
  5405. urls += "?" + c.urlParams_.Encode()
  5406. req, err := http.NewRequest("POST", urls, body)
  5407. if err != nil {
  5408. return nil, err
  5409. }
  5410. req.Header = reqHeaders
  5411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5412. }
  5413. // Do executes the "androidenterprise.enterprises.pullNotificationSet" call.
  5414. // Exactly one of *NotificationSet or error will be non-nil. Any non-2xx
  5415. // status code is an error. Response headers are in either
  5416. // *NotificationSet.ServerResponse.Header or (if a response was returned
  5417. // at all) in error.(*googleapi.Error).Header. Use
  5418. // googleapi.IsNotModified to check whether the returned error was
  5419. // because http.StatusNotModified was returned.
  5420. func (c *EnterprisesPullNotificationSetCall) Do(opts ...googleapi.CallOption) (*NotificationSet, error) {
  5421. gensupport.SetOptions(c.urlParams_, opts...)
  5422. res, err := c.doRequest("json")
  5423. if res != nil && res.StatusCode == http.StatusNotModified {
  5424. if res.Body != nil {
  5425. res.Body.Close()
  5426. }
  5427. return nil, &googleapi.Error{
  5428. Code: res.StatusCode,
  5429. Header: res.Header,
  5430. }
  5431. }
  5432. if err != nil {
  5433. return nil, err
  5434. }
  5435. defer googleapi.CloseBody(res)
  5436. if err := googleapi.CheckResponse(res); err != nil {
  5437. return nil, err
  5438. }
  5439. ret := &NotificationSet{
  5440. ServerResponse: googleapi.ServerResponse{
  5441. Header: res.Header,
  5442. HTTPStatusCode: res.StatusCode,
  5443. },
  5444. }
  5445. target := &ret
  5446. if err := gensupport.DecodeResponse(target, res); err != nil {
  5447. return nil, err
  5448. }
  5449. return ret, nil
  5450. // {
  5451. // "description": "Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending.\nA notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty.\nNotifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy.\nMultiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending.\nIf no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.",
  5452. // "httpMethod": "POST",
  5453. // "id": "androidenterprise.enterprises.pullNotificationSet",
  5454. // "parameters": {
  5455. // "requestMode": {
  5456. // "description": "The request mode for pulling notifications.\nSpecifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time.\nSpeciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present.\nIf omitted, defaults to waitForNotifications.",
  5457. // "enum": [
  5458. // "returnImmediately",
  5459. // "waitForNotifications"
  5460. // ],
  5461. // "enumDescriptions": [
  5462. // "",
  5463. // ""
  5464. // ],
  5465. // "location": "query",
  5466. // "type": "string"
  5467. // }
  5468. // },
  5469. // "path": "enterprises/pullNotificationSet",
  5470. // "response": {
  5471. // "$ref": "NotificationSet"
  5472. // },
  5473. // "scopes": [
  5474. // "https://www.googleapis.com/auth/androidenterprise"
  5475. // ]
  5476. // }
  5477. }
  5478. // method id "androidenterprise.enterprises.sendTestPushNotification":
  5479. type EnterprisesSendTestPushNotificationCall struct {
  5480. s *Service
  5481. enterpriseId string
  5482. urlParams_ gensupport.URLParams
  5483. ctx_ context.Context
  5484. header_ http.Header
  5485. }
  5486. // SendTestPushNotification: Sends a test notification to validate the
  5487. // EMM integration with the Google Cloud Pub/Sub service for this
  5488. // enterprise.
  5489. func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall {
  5490. c := &EnterprisesSendTestPushNotificationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5491. c.enterpriseId = enterpriseId
  5492. return c
  5493. }
  5494. // Fields allows partial responses to be retrieved. See
  5495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5496. // for more information.
  5497. func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall {
  5498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5499. return c
  5500. }
  5501. // Context sets the context to be used in this call's Do method. Any
  5502. // pending HTTP request will be aborted if the provided context is
  5503. // canceled.
  5504. func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall {
  5505. c.ctx_ = ctx
  5506. return c
  5507. }
  5508. // Header returns an http.Header that can be modified by the caller to
  5509. // add HTTP headers to the request.
  5510. func (c *EnterprisesSendTestPushNotificationCall) Header() http.Header {
  5511. if c.header_ == nil {
  5512. c.header_ = make(http.Header)
  5513. }
  5514. return c.header_
  5515. }
  5516. func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) {
  5517. reqHeaders := make(http.Header)
  5518. for k, v := range c.header_ {
  5519. reqHeaders[k] = v
  5520. }
  5521. reqHeaders.Set("User-Agent", c.s.userAgent())
  5522. var body io.Reader = nil
  5523. c.urlParams_.Set("alt", alt)
  5524. c.urlParams_.Set("prettyPrint", "false")
  5525. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/sendTestPushNotification")
  5526. urls += "?" + c.urlParams_.Encode()
  5527. req, err := http.NewRequest("POST", urls, body)
  5528. if err != nil {
  5529. return nil, err
  5530. }
  5531. req.Header = reqHeaders
  5532. googleapi.Expand(req.URL, map[string]string{
  5533. "enterpriseId": c.enterpriseId,
  5534. })
  5535. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5536. }
  5537. // Do executes the "androidenterprise.enterprises.sendTestPushNotification" call.
  5538. // Exactly one of *EnterprisesSendTestPushNotificationResponse or error
  5539. // will be non-nil. Any non-2xx status code is an error. Response
  5540. // headers are in either
  5541. // *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or
  5542. // (if a response was returned at all) in
  5543. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5544. // whether the returned error was because http.StatusNotModified was
  5545. // returned.
  5546. func (c *EnterprisesSendTestPushNotificationCall) Do(opts ...googleapi.CallOption) (*EnterprisesSendTestPushNotificationResponse, error) {
  5547. gensupport.SetOptions(c.urlParams_, opts...)
  5548. res, err := c.doRequest("json")
  5549. if res != nil && res.StatusCode == http.StatusNotModified {
  5550. if res.Body != nil {
  5551. res.Body.Close()
  5552. }
  5553. return nil, &googleapi.Error{
  5554. Code: res.StatusCode,
  5555. Header: res.Header,
  5556. }
  5557. }
  5558. if err != nil {
  5559. return nil, err
  5560. }
  5561. defer googleapi.CloseBody(res)
  5562. if err := googleapi.CheckResponse(res); err != nil {
  5563. return nil, err
  5564. }
  5565. ret := &EnterprisesSendTestPushNotificationResponse{
  5566. ServerResponse: googleapi.ServerResponse{
  5567. Header: res.Header,
  5568. HTTPStatusCode: res.StatusCode,
  5569. },
  5570. }
  5571. target := &ret
  5572. if err := gensupport.DecodeResponse(target, res); err != nil {
  5573. return nil, err
  5574. }
  5575. return ret, nil
  5576. // {
  5577. // "description": "Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.",
  5578. // "httpMethod": "POST",
  5579. // "id": "androidenterprise.enterprises.sendTestPushNotification",
  5580. // "parameterOrder": [
  5581. // "enterpriseId"
  5582. // ],
  5583. // "parameters": {
  5584. // "enterpriseId": {
  5585. // "description": "The ID of the enterprise.",
  5586. // "location": "path",
  5587. // "required": true,
  5588. // "type": "string"
  5589. // }
  5590. // },
  5591. // "path": "enterprises/{enterpriseId}/sendTestPushNotification",
  5592. // "response": {
  5593. // "$ref": "EnterprisesSendTestPushNotificationResponse"
  5594. // },
  5595. // "scopes": [
  5596. // "https://www.googleapis.com/auth/androidenterprise"
  5597. // ]
  5598. // }
  5599. }
  5600. // method id "androidenterprise.enterprises.setAccount":
  5601. type EnterprisesSetAccountCall struct {
  5602. s *Service
  5603. enterpriseId string
  5604. enterpriseaccount *EnterpriseAccount
  5605. urlParams_ gensupport.URLParams
  5606. ctx_ context.Context
  5607. header_ http.Header
  5608. }
  5609. // SetAccount: Sets the account that will be used to authenticate to the
  5610. // API as the enterprise.
  5611. func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall {
  5612. c := &EnterprisesSetAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5613. c.enterpriseId = enterpriseId
  5614. c.enterpriseaccount = enterpriseaccount
  5615. return c
  5616. }
  5617. // Fields allows partial responses to be retrieved. See
  5618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5619. // for more information.
  5620. func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall {
  5621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5622. return c
  5623. }
  5624. // Context sets the context to be used in this call's Do method. Any
  5625. // pending HTTP request will be aborted if the provided context is
  5626. // canceled.
  5627. func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall {
  5628. c.ctx_ = ctx
  5629. return c
  5630. }
  5631. // Header returns an http.Header that can be modified by the caller to
  5632. // add HTTP headers to the request.
  5633. func (c *EnterprisesSetAccountCall) Header() http.Header {
  5634. if c.header_ == nil {
  5635. c.header_ = make(http.Header)
  5636. }
  5637. return c.header_
  5638. }
  5639. func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) {
  5640. reqHeaders := make(http.Header)
  5641. for k, v := range c.header_ {
  5642. reqHeaders[k] = v
  5643. }
  5644. reqHeaders.Set("User-Agent", c.s.userAgent())
  5645. var body io.Reader = nil
  5646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount)
  5647. if err != nil {
  5648. return nil, err
  5649. }
  5650. reqHeaders.Set("Content-Type", "application/json")
  5651. c.urlParams_.Set("alt", alt)
  5652. c.urlParams_.Set("prettyPrint", "false")
  5653. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/account")
  5654. urls += "?" + c.urlParams_.Encode()
  5655. req, err := http.NewRequest("PUT", urls, body)
  5656. if err != nil {
  5657. return nil, err
  5658. }
  5659. req.Header = reqHeaders
  5660. googleapi.Expand(req.URL, map[string]string{
  5661. "enterpriseId": c.enterpriseId,
  5662. })
  5663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5664. }
  5665. // Do executes the "androidenterprise.enterprises.setAccount" call.
  5666. // Exactly one of *EnterpriseAccount or error will be non-nil. Any
  5667. // non-2xx status code is an error. Response headers are in either
  5668. // *EnterpriseAccount.ServerResponse.Header or (if a response was
  5669. // returned at all) in error.(*googleapi.Error).Header. Use
  5670. // googleapi.IsNotModified to check whether the returned error was
  5671. // because http.StatusNotModified was returned.
  5672. func (c *EnterprisesSetAccountCall) Do(opts ...googleapi.CallOption) (*EnterpriseAccount, error) {
  5673. gensupport.SetOptions(c.urlParams_, opts...)
  5674. res, err := c.doRequest("json")
  5675. if res != nil && res.StatusCode == http.StatusNotModified {
  5676. if res.Body != nil {
  5677. res.Body.Close()
  5678. }
  5679. return nil, &googleapi.Error{
  5680. Code: res.StatusCode,
  5681. Header: res.Header,
  5682. }
  5683. }
  5684. if err != nil {
  5685. return nil, err
  5686. }
  5687. defer googleapi.CloseBody(res)
  5688. if err := googleapi.CheckResponse(res); err != nil {
  5689. return nil, err
  5690. }
  5691. ret := &EnterpriseAccount{
  5692. ServerResponse: googleapi.ServerResponse{
  5693. Header: res.Header,
  5694. HTTPStatusCode: res.StatusCode,
  5695. },
  5696. }
  5697. target := &ret
  5698. if err := gensupport.DecodeResponse(target, res); err != nil {
  5699. return nil, err
  5700. }
  5701. return ret, nil
  5702. // {
  5703. // "description": "Sets the account that will be used to authenticate to the API as the enterprise.",
  5704. // "httpMethod": "PUT",
  5705. // "id": "androidenterprise.enterprises.setAccount",
  5706. // "parameterOrder": [
  5707. // "enterpriseId"
  5708. // ],
  5709. // "parameters": {
  5710. // "enterpriseId": {
  5711. // "description": "The ID of the enterprise.",
  5712. // "location": "path",
  5713. // "required": true,
  5714. // "type": "string"
  5715. // }
  5716. // },
  5717. // "path": "enterprises/{enterpriseId}/account",
  5718. // "request": {
  5719. // "$ref": "EnterpriseAccount"
  5720. // },
  5721. // "response": {
  5722. // "$ref": "EnterpriseAccount"
  5723. // },
  5724. // "scopes": [
  5725. // "https://www.googleapis.com/auth/androidenterprise"
  5726. // ]
  5727. // }
  5728. }
  5729. // method id "androidenterprise.enterprises.setAndroidDevicePolicyConfig":
  5730. type EnterprisesSetAndroidDevicePolicyConfigCall struct {
  5731. s *Service
  5732. enterpriseId string
  5733. androiddevicepolicyconfig *AndroidDevicePolicyConfig
  5734. urlParams_ gensupport.URLParams
  5735. ctx_ context.Context
  5736. header_ http.Header
  5737. }
  5738. // SetAndroidDevicePolicyConfig: Deprecated and unused.
  5739. func (r *EnterprisesService) SetAndroidDevicePolicyConfig(enterpriseId string, androiddevicepolicyconfig *AndroidDevicePolicyConfig) *EnterprisesSetAndroidDevicePolicyConfigCall {
  5740. c := &EnterprisesSetAndroidDevicePolicyConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5741. c.enterpriseId = enterpriseId
  5742. c.androiddevicepolicyconfig = androiddevicepolicyconfig
  5743. return c
  5744. }
  5745. // Fields allows partial responses to be retrieved. See
  5746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5747. // for more information.
  5748. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Fields(s ...googleapi.Field) *EnterprisesSetAndroidDevicePolicyConfigCall {
  5749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5750. return c
  5751. }
  5752. // Context sets the context to be used in this call's Do method. Any
  5753. // pending HTTP request will be aborted if the provided context is
  5754. // canceled.
  5755. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Context(ctx context.Context) *EnterprisesSetAndroidDevicePolicyConfigCall {
  5756. c.ctx_ = ctx
  5757. return c
  5758. }
  5759. // Header returns an http.Header that can be modified by the caller to
  5760. // add HTTP headers to the request.
  5761. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Header() http.Header {
  5762. if c.header_ == nil {
  5763. c.header_ = make(http.Header)
  5764. }
  5765. return c.header_
  5766. }
  5767. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) doRequest(alt string) (*http.Response, error) {
  5768. reqHeaders := make(http.Header)
  5769. for k, v := range c.header_ {
  5770. reqHeaders[k] = v
  5771. }
  5772. reqHeaders.Set("User-Agent", c.s.userAgent())
  5773. var body io.Reader = nil
  5774. body, err := googleapi.WithoutDataWrapper.JSONReader(c.androiddevicepolicyconfig)
  5775. if err != nil {
  5776. return nil, err
  5777. }
  5778. reqHeaders.Set("Content-Type", "application/json")
  5779. c.urlParams_.Set("alt", alt)
  5780. c.urlParams_.Set("prettyPrint", "false")
  5781. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/androidDevicePolicyConfig")
  5782. urls += "?" + c.urlParams_.Encode()
  5783. req, err := http.NewRequest("PUT", urls, body)
  5784. if err != nil {
  5785. return nil, err
  5786. }
  5787. req.Header = reqHeaders
  5788. googleapi.Expand(req.URL, map[string]string{
  5789. "enterpriseId": c.enterpriseId,
  5790. })
  5791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5792. }
  5793. // Do executes the "androidenterprise.enterprises.setAndroidDevicePolicyConfig" call.
  5794. // Exactly one of *AndroidDevicePolicyConfig or error will be non-nil.
  5795. // Any non-2xx status code is an error. Response headers are in either
  5796. // *AndroidDevicePolicyConfig.ServerResponse.Header or (if a response
  5797. // was returned at all) in error.(*googleapi.Error).Header. Use
  5798. // googleapi.IsNotModified to check whether the returned error was
  5799. // because http.StatusNotModified was returned.
  5800. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Do(opts ...googleapi.CallOption) (*AndroidDevicePolicyConfig, error) {
  5801. gensupport.SetOptions(c.urlParams_, opts...)
  5802. res, err := c.doRequest("json")
  5803. if res != nil && res.StatusCode == http.StatusNotModified {
  5804. if res.Body != nil {
  5805. res.Body.Close()
  5806. }
  5807. return nil, &googleapi.Error{
  5808. Code: res.StatusCode,
  5809. Header: res.Header,
  5810. }
  5811. }
  5812. if err != nil {
  5813. return nil, err
  5814. }
  5815. defer googleapi.CloseBody(res)
  5816. if err := googleapi.CheckResponse(res); err != nil {
  5817. return nil, err
  5818. }
  5819. ret := &AndroidDevicePolicyConfig{
  5820. ServerResponse: googleapi.ServerResponse{
  5821. Header: res.Header,
  5822. HTTPStatusCode: res.StatusCode,
  5823. },
  5824. }
  5825. target := &ret
  5826. if err := gensupport.DecodeResponse(target, res); err != nil {
  5827. return nil, err
  5828. }
  5829. return ret, nil
  5830. // {
  5831. // "description": "Deprecated and unused.",
  5832. // "httpMethod": "PUT",
  5833. // "id": "androidenterprise.enterprises.setAndroidDevicePolicyConfig",
  5834. // "parameterOrder": [
  5835. // "enterpriseId"
  5836. // ],
  5837. // "parameters": {
  5838. // "enterpriseId": {
  5839. // "description": "The ID of the enterprise.",
  5840. // "location": "path",
  5841. // "required": true,
  5842. // "type": "string"
  5843. // }
  5844. // },
  5845. // "path": "enterprises/{enterpriseId}/androidDevicePolicyConfig",
  5846. // "request": {
  5847. // "$ref": "AndroidDevicePolicyConfig"
  5848. // },
  5849. // "response": {
  5850. // "$ref": "AndroidDevicePolicyConfig"
  5851. // },
  5852. // "scopes": [
  5853. // "https://www.googleapis.com/auth/androidenterprise"
  5854. // ]
  5855. // }
  5856. }
  5857. // method id "androidenterprise.enterprises.setStoreLayout":
  5858. type EnterprisesSetStoreLayoutCall struct {
  5859. s *Service
  5860. enterpriseId string
  5861. storelayout *StoreLayout
  5862. urlParams_ gensupport.URLParams
  5863. ctx_ context.Context
  5864. header_ http.Header
  5865. }
  5866. // SetStoreLayout: Sets the store layout for the enterprise. By default,
  5867. // storeLayoutType is set to "basic" and the basic store layout is
  5868. // enabled. The basic layout only contains apps approved by the admin,
  5869. // and that have been added to the available product set for a user
  5870. // (using the setAvailableProductSet call). Apps on the page are sorted
  5871. // in order of their product ID value. If you create a custom store
  5872. // layout (by setting storeLayoutType = "custom" and setting a
  5873. // homepage), the basic store layout is disabled.
  5874. func (r *EnterprisesService) SetStoreLayout(enterpriseId string, storelayout *StoreLayout) *EnterprisesSetStoreLayoutCall {
  5875. c := &EnterprisesSetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5876. c.enterpriseId = enterpriseId
  5877. c.storelayout = storelayout
  5878. return c
  5879. }
  5880. // Fields allows partial responses to be retrieved. See
  5881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5882. // for more information.
  5883. func (c *EnterprisesSetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesSetStoreLayoutCall {
  5884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5885. return c
  5886. }
  5887. // Context sets the context to be used in this call's Do method. Any
  5888. // pending HTTP request will be aborted if the provided context is
  5889. // canceled.
  5890. func (c *EnterprisesSetStoreLayoutCall) Context(ctx context.Context) *EnterprisesSetStoreLayoutCall {
  5891. c.ctx_ = ctx
  5892. return c
  5893. }
  5894. // Header returns an http.Header that can be modified by the caller to
  5895. // add HTTP headers to the request.
  5896. func (c *EnterprisesSetStoreLayoutCall) Header() http.Header {
  5897. if c.header_ == nil {
  5898. c.header_ = make(http.Header)
  5899. }
  5900. return c.header_
  5901. }
  5902. func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) {
  5903. reqHeaders := make(http.Header)
  5904. for k, v := range c.header_ {
  5905. reqHeaders[k] = v
  5906. }
  5907. reqHeaders.Set("User-Agent", c.s.userAgent())
  5908. var body io.Reader = nil
  5909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout)
  5910. if err != nil {
  5911. return nil, err
  5912. }
  5913. reqHeaders.Set("Content-Type", "application/json")
  5914. c.urlParams_.Set("alt", alt)
  5915. c.urlParams_.Set("prettyPrint", "false")
  5916. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout")
  5917. urls += "?" + c.urlParams_.Encode()
  5918. req, err := http.NewRequest("PUT", urls, body)
  5919. if err != nil {
  5920. return nil, err
  5921. }
  5922. req.Header = reqHeaders
  5923. googleapi.Expand(req.URL, map[string]string{
  5924. "enterpriseId": c.enterpriseId,
  5925. })
  5926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5927. }
  5928. // Do executes the "androidenterprise.enterprises.setStoreLayout" call.
  5929. // Exactly one of *StoreLayout or error will be non-nil. Any non-2xx
  5930. // status code is an error. Response headers are in either
  5931. // *StoreLayout.ServerResponse.Header or (if a response was returned at
  5932. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5933. // to check whether the returned error was because
  5934. // http.StatusNotModified was returned.
  5935. func (c *EnterprisesSetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) {
  5936. gensupport.SetOptions(c.urlParams_, opts...)
  5937. res, err := c.doRequest("json")
  5938. if res != nil && res.StatusCode == http.StatusNotModified {
  5939. if res.Body != nil {
  5940. res.Body.Close()
  5941. }
  5942. return nil, &googleapi.Error{
  5943. Code: res.StatusCode,
  5944. Header: res.Header,
  5945. }
  5946. }
  5947. if err != nil {
  5948. return nil, err
  5949. }
  5950. defer googleapi.CloseBody(res)
  5951. if err := googleapi.CheckResponse(res); err != nil {
  5952. return nil, err
  5953. }
  5954. ret := &StoreLayout{
  5955. ServerResponse: googleapi.ServerResponse{
  5956. Header: res.Header,
  5957. HTTPStatusCode: res.StatusCode,
  5958. },
  5959. }
  5960. target := &ret
  5961. if err := gensupport.DecodeResponse(target, res); err != nil {
  5962. return nil, err
  5963. }
  5964. return ret, nil
  5965. // {
  5966. // "description": "Sets the store layout for the enterprise. By default, storeLayoutType is set to \"basic\" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = \"custom\" and setting a homepage), the basic store layout is disabled.",
  5967. // "httpMethod": "PUT",
  5968. // "id": "androidenterprise.enterprises.setStoreLayout",
  5969. // "parameterOrder": [
  5970. // "enterpriseId"
  5971. // ],
  5972. // "parameters": {
  5973. // "enterpriseId": {
  5974. // "description": "The ID of the enterprise.",
  5975. // "location": "path",
  5976. // "required": true,
  5977. // "type": "string"
  5978. // }
  5979. // },
  5980. // "path": "enterprises/{enterpriseId}/storeLayout",
  5981. // "request": {
  5982. // "$ref": "StoreLayout"
  5983. // },
  5984. // "response": {
  5985. // "$ref": "StoreLayout"
  5986. // },
  5987. // "scopes": [
  5988. // "https://www.googleapis.com/auth/androidenterprise"
  5989. // ]
  5990. // }
  5991. }
  5992. // method id "androidenterprise.enterprises.unenroll":
  5993. type EnterprisesUnenrollCall struct {
  5994. s *Service
  5995. enterpriseId string
  5996. urlParams_ gensupport.URLParams
  5997. ctx_ context.Context
  5998. header_ http.Header
  5999. }
  6000. // Unenroll: Unenrolls an enterprise from the calling EMM.
  6001. func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall {
  6002. c := &EnterprisesUnenrollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6003. c.enterpriseId = enterpriseId
  6004. return c
  6005. }
  6006. // Fields allows partial responses to be retrieved. See
  6007. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6008. // for more information.
  6009. func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall {
  6010. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6011. return c
  6012. }
  6013. // Context sets the context to be used in this call's Do method. Any
  6014. // pending HTTP request will be aborted if the provided context is
  6015. // canceled.
  6016. func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall {
  6017. c.ctx_ = ctx
  6018. return c
  6019. }
  6020. // Header returns an http.Header that can be modified by the caller to
  6021. // add HTTP headers to the request.
  6022. func (c *EnterprisesUnenrollCall) Header() http.Header {
  6023. if c.header_ == nil {
  6024. c.header_ = make(http.Header)
  6025. }
  6026. return c.header_
  6027. }
  6028. func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) {
  6029. reqHeaders := make(http.Header)
  6030. for k, v := range c.header_ {
  6031. reqHeaders[k] = v
  6032. }
  6033. reqHeaders.Set("User-Agent", c.s.userAgent())
  6034. var body io.Reader = nil
  6035. c.urlParams_.Set("alt", alt)
  6036. c.urlParams_.Set("prettyPrint", "false")
  6037. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/unenroll")
  6038. urls += "?" + c.urlParams_.Encode()
  6039. req, err := http.NewRequest("POST", urls, body)
  6040. if err != nil {
  6041. return nil, err
  6042. }
  6043. req.Header = reqHeaders
  6044. googleapi.Expand(req.URL, map[string]string{
  6045. "enterpriseId": c.enterpriseId,
  6046. })
  6047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6048. }
  6049. // Do executes the "androidenterprise.enterprises.unenroll" call.
  6050. func (c *EnterprisesUnenrollCall) Do(opts ...googleapi.CallOption) error {
  6051. gensupport.SetOptions(c.urlParams_, opts...)
  6052. res, err := c.doRequest("json")
  6053. if err != nil {
  6054. return err
  6055. }
  6056. defer googleapi.CloseBody(res)
  6057. if err := googleapi.CheckResponse(res); err != nil {
  6058. return err
  6059. }
  6060. return nil
  6061. // {
  6062. // "description": "Unenrolls an enterprise from the calling EMM.",
  6063. // "httpMethod": "POST",
  6064. // "id": "androidenterprise.enterprises.unenroll",
  6065. // "parameterOrder": [
  6066. // "enterpriseId"
  6067. // ],
  6068. // "parameters": {
  6069. // "enterpriseId": {
  6070. // "description": "The ID of the enterprise.",
  6071. // "location": "path",
  6072. // "required": true,
  6073. // "type": "string"
  6074. // }
  6075. // },
  6076. // "path": "enterprises/{enterpriseId}/unenroll",
  6077. // "scopes": [
  6078. // "https://www.googleapis.com/auth/androidenterprise"
  6079. // ]
  6080. // }
  6081. }
  6082. // method id "androidenterprise.entitlements.delete":
  6083. type EntitlementsDeleteCall struct {
  6084. s *Service
  6085. enterpriseId string
  6086. userId string
  6087. entitlementId string
  6088. urlParams_ gensupport.URLParams
  6089. ctx_ context.Context
  6090. header_ http.Header
  6091. }
  6092. // Delete: Removes an entitlement to an app for a user.
  6093. func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall {
  6094. c := &EntitlementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6095. c.enterpriseId = enterpriseId
  6096. c.userId = userId
  6097. c.entitlementId = entitlementId
  6098. return c
  6099. }
  6100. // Fields allows partial responses to be retrieved. See
  6101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6102. // for more information.
  6103. func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall {
  6104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6105. return c
  6106. }
  6107. // Context sets the context to be used in this call's Do method. Any
  6108. // pending HTTP request will be aborted if the provided context is
  6109. // canceled.
  6110. func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall {
  6111. c.ctx_ = ctx
  6112. return c
  6113. }
  6114. // Header returns an http.Header that can be modified by the caller to
  6115. // add HTTP headers to the request.
  6116. func (c *EntitlementsDeleteCall) Header() http.Header {
  6117. if c.header_ == nil {
  6118. c.header_ = make(http.Header)
  6119. }
  6120. return c.header_
  6121. }
  6122. func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6123. reqHeaders := make(http.Header)
  6124. for k, v := range c.header_ {
  6125. reqHeaders[k] = v
  6126. }
  6127. reqHeaders.Set("User-Agent", c.s.userAgent())
  6128. var body io.Reader = nil
  6129. c.urlParams_.Set("alt", alt)
  6130. c.urlParams_.Set("prettyPrint", "false")
  6131. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6132. urls += "?" + c.urlParams_.Encode()
  6133. req, err := http.NewRequest("DELETE", urls, body)
  6134. if err != nil {
  6135. return nil, err
  6136. }
  6137. req.Header = reqHeaders
  6138. googleapi.Expand(req.URL, map[string]string{
  6139. "enterpriseId": c.enterpriseId,
  6140. "userId": c.userId,
  6141. "entitlementId": c.entitlementId,
  6142. })
  6143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6144. }
  6145. // Do executes the "androidenterprise.entitlements.delete" call.
  6146. func (c *EntitlementsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6147. gensupport.SetOptions(c.urlParams_, opts...)
  6148. res, err := c.doRequest("json")
  6149. if err != nil {
  6150. return err
  6151. }
  6152. defer googleapi.CloseBody(res)
  6153. if err := googleapi.CheckResponse(res); err != nil {
  6154. return err
  6155. }
  6156. return nil
  6157. // {
  6158. // "description": "Removes an entitlement to an app for a user.",
  6159. // "httpMethod": "DELETE",
  6160. // "id": "androidenterprise.entitlements.delete",
  6161. // "parameterOrder": [
  6162. // "enterpriseId",
  6163. // "userId",
  6164. // "entitlementId"
  6165. // ],
  6166. // "parameters": {
  6167. // "enterpriseId": {
  6168. // "description": "The ID of the enterprise.",
  6169. // "location": "path",
  6170. // "required": true,
  6171. // "type": "string"
  6172. // },
  6173. // "entitlementId": {
  6174. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6175. // "location": "path",
  6176. // "required": true,
  6177. // "type": "string"
  6178. // },
  6179. // "userId": {
  6180. // "description": "The ID of the user.",
  6181. // "location": "path",
  6182. // "required": true,
  6183. // "type": "string"
  6184. // }
  6185. // },
  6186. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6187. // "scopes": [
  6188. // "https://www.googleapis.com/auth/androidenterprise"
  6189. // ]
  6190. // }
  6191. }
  6192. // method id "androidenterprise.entitlements.get":
  6193. type EntitlementsGetCall struct {
  6194. s *Service
  6195. enterpriseId string
  6196. userId string
  6197. entitlementId string
  6198. urlParams_ gensupport.URLParams
  6199. ifNoneMatch_ string
  6200. ctx_ context.Context
  6201. header_ http.Header
  6202. }
  6203. // Get: Retrieves details of an entitlement.
  6204. func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall {
  6205. c := &EntitlementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6206. c.enterpriseId = enterpriseId
  6207. c.userId = userId
  6208. c.entitlementId = entitlementId
  6209. return c
  6210. }
  6211. // Fields allows partial responses to be retrieved. See
  6212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6213. // for more information.
  6214. func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall {
  6215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6216. return c
  6217. }
  6218. // IfNoneMatch sets the optional parameter which makes the operation
  6219. // fail if the object's ETag matches the given value. This is useful for
  6220. // getting updates only after the object has changed since the last
  6221. // request. Use googleapi.IsNotModified to check whether the response
  6222. // error from Do is the result of In-None-Match.
  6223. func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall {
  6224. c.ifNoneMatch_ = entityTag
  6225. return c
  6226. }
  6227. // Context sets the context to be used in this call's Do method. Any
  6228. // pending HTTP request will be aborted if the provided context is
  6229. // canceled.
  6230. func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall {
  6231. c.ctx_ = ctx
  6232. return c
  6233. }
  6234. // Header returns an http.Header that can be modified by the caller to
  6235. // add HTTP headers to the request.
  6236. func (c *EntitlementsGetCall) Header() http.Header {
  6237. if c.header_ == nil {
  6238. c.header_ = make(http.Header)
  6239. }
  6240. return c.header_
  6241. }
  6242. func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) {
  6243. reqHeaders := make(http.Header)
  6244. for k, v := range c.header_ {
  6245. reqHeaders[k] = v
  6246. }
  6247. reqHeaders.Set("User-Agent", c.s.userAgent())
  6248. if c.ifNoneMatch_ != "" {
  6249. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6250. }
  6251. var body io.Reader = nil
  6252. c.urlParams_.Set("alt", alt)
  6253. c.urlParams_.Set("prettyPrint", "false")
  6254. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6255. urls += "?" + c.urlParams_.Encode()
  6256. req, err := http.NewRequest("GET", urls, body)
  6257. if err != nil {
  6258. return nil, err
  6259. }
  6260. req.Header = reqHeaders
  6261. googleapi.Expand(req.URL, map[string]string{
  6262. "enterpriseId": c.enterpriseId,
  6263. "userId": c.userId,
  6264. "entitlementId": c.entitlementId,
  6265. })
  6266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6267. }
  6268. // Do executes the "androidenterprise.entitlements.get" call.
  6269. // Exactly one of *Entitlement or error will be non-nil. Any non-2xx
  6270. // status code is an error. Response headers are in either
  6271. // *Entitlement.ServerResponse.Header or (if a response was returned at
  6272. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6273. // to check whether the returned error was because
  6274. // http.StatusNotModified was returned.
  6275. func (c *EntitlementsGetCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
  6276. gensupport.SetOptions(c.urlParams_, opts...)
  6277. res, err := c.doRequest("json")
  6278. if res != nil && res.StatusCode == http.StatusNotModified {
  6279. if res.Body != nil {
  6280. res.Body.Close()
  6281. }
  6282. return nil, &googleapi.Error{
  6283. Code: res.StatusCode,
  6284. Header: res.Header,
  6285. }
  6286. }
  6287. if err != nil {
  6288. return nil, err
  6289. }
  6290. defer googleapi.CloseBody(res)
  6291. if err := googleapi.CheckResponse(res); err != nil {
  6292. return nil, err
  6293. }
  6294. ret := &Entitlement{
  6295. ServerResponse: googleapi.ServerResponse{
  6296. Header: res.Header,
  6297. HTTPStatusCode: res.StatusCode,
  6298. },
  6299. }
  6300. target := &ret
  6301. if err := gensupport.DecodeResponse(target, res); err != nil {
  6302. return nil, err
  6303. }
  6304. return ret, nil
  6305. // {
  6306. // "description": "Retrieves details of an entitlement.",
  6307. // "httpMethod": "GET",
  6308. // "id": "androidenterprise.entitlements.get",
  6309. // "parameterOrder": [
  6310. // "enterpriseId",
  6311. // "userId",
  6312. // "entitlementId"
  6313. // ],
  6314. // "parameters": {
  6315. // "enterpriseId": {
  6316. // "description": "The ID of the enterprise.",
  6317. // "location": "path",
  6318. // "required": true,
  6319. // "type": "string"
  6320. // },
  6321. // "entitlementId": {
  6322. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6323. // "location": "path",
  6324. // "required": true,
  6325. // "type": "string"
  6326. // },
  6327. // "userId": {
  6328. // "description": "The ID of the user.",
  6329. // "location": "path",
  6330. // "required": true,
  6331. // "type": "string"
  6332. // }
  6333. // },
  6334. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6335. // "response": {
  6336. // "$ref": "Entitlement"
  6337. // },
  6338. // "scopes": [
  6339. // "https://www.googleapis.com/auth/androidenterprise"
  6340. // ]
  6341. // }
  6342. }
  6343. // method id "androidenterprise.entitlements.list":
  6344. type EntitlementsListCall struct {
  6345. s *Service
  6346. enterpriseId string
  6347. userId string
  6348. urlParams_ gensupport.URLParams
  6349. ifNoneMatch_ string
  6350. ctx_ context.Context
  6351. header_ http.Header
  6352. }
  6353. // List: Lists all entitlements for the specified user. Only the ID is
  6354. // set.
  6355. func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall {
  6356. c := &EntitlementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6357. c.enterpriseId = enterpriseId
  6358. c.userId = userId
  6359. return c
  6360. }
  6361. // Fields allows partial responses to be retrieved. See
  6362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6363. // for more information.
  6364. func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall {
  6365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6366. return c
  6367. }
  6368. // IfNoneMatch sets the optional parameter which makes the operation
  6369. // fail if the object's ETag matches the given value. This is useful for
  6370. // getting updates only after the object has changed since the last
  6371. // request. Use googleapi.IsNotModified to check whether the response
  6372. // error from Do is the result of In-None-Match.
  6373. func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall {
  6374. c.ifNoneMatch_ = entityTag
  6375. return c
  6376. }
  6377. // Context sets the context to be used in this call's Do method. Any
  6378. // pending HTTP request will be aborted if the provided context is
  6379. // canceled.
  6380. func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall {
  6381. c.ctx_ = ctx
  6382. return c
  6383. }
  6384. // Header returns an http.Header that can be modified by the caller to
  6385. // add HTTP headers to the request.
  6386. func (c *EntitlementsListCall) Header() http.Header {
  6387. if c.header_ == nil {
  6388. c.header_ = make(http.Header)
  6389. }
  6390. return c.header_
  6391. }
  6392. func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) {
  6393. reqHeaders := make(http.Header)
  6394. for k, v := range c.header_ {
  6395. reqHeaders[k] = v
  6396. }
  6397. reqHeaders.Set("User-Agent", c.s.userAgent())
  6398. if c.ifNoneMatch_ != "" {
  6399. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6400. }
  6401. var body io.Reader = nil
  6402. c.urlParams_.Set("alt", alt)
  6403. c.urlParams_.Set("prettyPrint", "false")
  6404. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements")
  6405. urls += "?" + c.urlParams_.Encode()
  6406. req, err := http.NewRequest("GET", urls, body)
  6407. if err != nil {
  6408. return nil, err
  6409. }
  6410. req.Header = reqHeaders
  6411. googleapi.Expand(req.URL, map[string]string{
  6412. "enterpriseId": c.enterpriseId,
  6413. "userId": c.userId,
  6414. })
  6415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6416. }
  6417. // Do executes the "androidenterprise.entitlements.list" call.
  6418. // Exactly one of *EntitlementsListResponse or error will be non-nil.
  6419. // Any non-2xx status code is an error. Response headers are in either
  6420. // *EntitlementsListResponse.ServerResponse.Header or (if a response was
  6421. // returned at all) in error.(*googleapi.Error).Header. Use
  6422. // googleapi.IsNotModified to check whether the returned error was
  6423. // because http.StatusNotModified was returned.
  6424. func (c *EntitlementsListCall) Do(opts ...googleapi.CallOption) (*EntitlementsListResponse, error) {
  6425. gensupport.SetOptions(c.urlParams_, opts...)
  6426. res, err := c.doRequest("json")
  6427. if res != nil && res.StatusCode == http.StatusNotModified {
  6428. if res.Body != nil {
  6429. res.Body.Close()
  6430. }
  6431. return nil, &googleapi.Error{
  6432. Code: res.StatusCode,
  6433. Header: res.Header,
  6434. }
  6435. }
  6436. if err != nil {
  6437. return nil, err
  6438. }
  6439. defer googleapi.CloseBody(res)
  6440. if err := googleapi.CheckResponse(res); err != nil {
  6441. return nil, err
  6442. }
  6443. ret := &EntitlementsListResponse{
  6444. ServerResponse: googleapi.ServerResponse{
  6445. Header: res.Header,
  6446. HTTPStatusCode: res.StatusCode,
  6447. },
  6448. }
  6449. target := &ret
  6450. if err := gensupport.DecodeResponse(target, res); err != nil {
  6451. return nil, err
  6452. }
  6453. return ret, nil
  6454. // {
  6455. // "description": "Lists all entitlements for the specified user. Only the ID is set.",
  6456. // "httpMethod": "GET",
  6457. // "id": "androidenterprise.entitlements.list",
  6458. // "parameterOrder": [
  6459. // "enterpriseId",
  6460. // "userId"
  6461. // ],
  6462. // "parameters": {
  6463. // "enterpriseId": {
  6464. // "description": "The ID of the enterprise.",
  6465. // "location": "path",
  6466. // "required": true,
  6467. // "type": "string"
  6468. // },
  6469. // "userId": {
  6470. // "description": "The ID of the user.",
  6471. // "location": "path",
  6472. // "required": true,
  6473. // "type": "string"
  6474. // }
  6475. // },
  6476. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements",
  6477. // "response": {
  6478. // "$ref": "EntitlementsListResponse"
  6479. // },
  6480. // "scopes": [
  6481. // "https://www.googleapis.com/auth/androidenterprise"
  6482. // ]
  6483. // }
  6484. }
  6485. // method id "androidenterprise.entitlements.patch":
  6486. type EntitlementsPatchCall struct {
  6487. s *Service
  6488. enterpriseId string
  6489. userId string
  6490. entitlementId string
  6491. entitlement *Entitlement
  6492. urlParams_ gensupport.URLParams
  6493. ctx_ context.Context
  6494. header_ http.Header
  6495. }
  6496. // Patch: Adds or updates an entitlement to an app for a user. This
  6497. // method supports patch semantics.
  6498. func (r *EntitlementsService) Patch(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsPatchCall {
  6499. c := &EntitlementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6500. c.enterpriseId = enterpriseId
  6501. c.userId = userId
  6502. c.entitlementId = entitlementId
  6503. c.entitlement = entitlement
  6504. return c
  6505. }
  6506. // Install sets the optional parameter "install": Set to true to also
  6507. // install the product on all the user's devices where possible. Failure
  6508. // to install on one or more devices will not prevent this operation
  6509. // from returning successfully, as long as the entitlement was
  6510. // successfully assigned to the user.
  6511. func (c *EntitlementsPatchCall) Install(install bool) *EntitlementsPatchCall {
  6512. c.urlParams_.Set("install", fmt.Sprint(install))
  6513. return c
  6514. }
  6515. // Fields allows partial responses to be retrieved. See
  6516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6517. // for more information.
  6518. func (c *EntitlementsPatchCall) Fields(s ...googleapi.Field) *EntitlementsPatchCall {
  6519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6520. return c
  6521. }
  6522. // Context sets the context to be used in this call's Do method. Any
  6523. // pending HTTP request will be aborted if the provided context is
  6524. // canceled.
  6525. func (c *EntitlementsPatchCall) Context(ctx context.Context) *EntitlementsPatchCall {
  6526. c.ctx_ = ctx
  6527. return c
  6528. }
  6529. // Header returns an http.Header that can be modified by the caller to
  6530. // add HTTP headers to the request.
  6531. func (c *EntitlementsPatchCall) Header() http.Header {
  6532. if c.header_ == nil {
  6533. c.header_ = make(http.Header)
  6534. }
  6535. return c.header_
  6536. }
  6537. func (c *EntitlementsPatchCall) doRequest(alt string) (*http.Response, error) {
  6538. reqHeaders := make(http.Header)
  6539. for k, v := range c.header_ {
  6540. reqHeaders[k] = v
  6541. }
  6542. reqHeaders.Set("User-Agent", c.s.userAgent())
  6543. var body io.Reader = nil
  6544. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
  6545. if err != nil {
  6546. return nil, err
  6547. }
  6548. reqHeaders.Set("Content-Type", "application/json")
  6549. c.urlParams_.Set("alt", alt)
  6550. c.urlParams_.Set("prettyPrint", "false")
  6551. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6552. urls += "?" + c.urlParams_.Encode()
  6553. req, err := http.NewRequest("PATCH", urls, body)
  6554. if err != nil {
  6555. return nil, err
  6556. }
  6557. req.Header = reqHeaders
  6558. googleapi.Expand(req.URL, map[string]string{
  6559. "enterpriseId": c.enterpriseId,
  6560. "userId": c.userId,
  6561. "entitlementId": c.entitlementId,
  6562. })
  6563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6564. }
  6565. // Do executes the "androidenterprise.entitlements.patch" call.
  6566. // Exactly one of *Entitlement or error will be non-nil. Any non-2xx
  6567. // status code is an error. Response headers are in either
  6568. // *Entitlement.ServerResponse.Header or (if a response was returned at
  6569. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6570. // to check whether the returned error was because
  6571. // http.StatusNotModified was returned.
  6572. func (c *EntitlementsPatchCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
  6573. gensupport.SetOptions(c.urlParams_, opts...)
  6574. res, err := c.doRequest("json")
  6575. if res != nil && res.StatusCode == http.StatusNotModified {
  6576. if res.Body != nil {
  6577. res.Body.Close()
  6578. }
  6579. return nil, &googleapi.Error{
  6580. Code: res.StatusCode,
  6581. Header: res.Header,
  6582. }
  6583. }
  6584. if err != nil {
  6585. return nil, err
  6586. }
  6587. defer googleapi.CloseBody(res)
  6588. if err := googleapi.CheckResponse(res); err != nil {
  6589. return nil, err
  6590. }
  6591. ret := &Entitlement{
  6592. ServerResponse: googleapi.ServerResponse{
  6593. Header: res.Header,
  6594. HTTPStatusCode: res.StatusCode,
  6595. },
  6596. }
  6597. target := &ret
  6598. if err := gensupport.DecodeResponse(target, res); err != nil {
  6599. return nil, err
  6600. }
  6601. return ret, nil
  6602. // {
  6603. // "description": "Adds or updates an entitlement to an app for a user. This method supports patch semantics.",
  6604. // "httpMethod": "PATCH",
  6605. // "id": "androidenterprise.entitlements.patch",
  6606. // "parameterOrder": [
  6607. // "enterpriseId",
  6608. // "userId",
  6609. // "entitlementId"
  6610. // ],
  6611. // "parameters": {
  6612. // "enterpriseId": {
  6613. // "description": "The ID of the enterprise.",
  6614. // "location": "path",
  6615. // "required": true,
  6616. // "type": "string"
  6617. // },
  6618. // "entitlementId": {
  6619. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6620. // "location": "path",
  6621. // "required": true,
  6622. // "type": "string"
  6623. // },
  6624. // "install": {
  6625. // "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.",
  6626. // "location": "query",
  6627. // "type": "boolean"
  6628. // },
  6629. // "userId": {
  6630. // "description": "The ID of the user.",
  6631. // "location": "path",
  6632. // "required": true,
  6633. // "type": "string"
  6634. // }
  6635. // },
  6636. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6637. // "request": {
  6638. // "$ref": "Entitlement"
  6639. // },
  6640. // "response": {
  6641. // "$ref": "Entitlement"
  6642. // },
  6643. // "scopes": [
  6644. // "https://www.googleapis.com/auth/androidenterprise"
  6645. // ]
  6646. // }
  6647. }
  6648. // method id "androidenterprise.entitlements.update":
  6649. type EntitlementsUpdateCall struct {
  6650. s *Service
  6651. enterpriseId string
  6652. userId string
  6653. entitlementId string
  6654. entitlement *Entitlement
  6655. urlParams_ gensupport.URLParams
  6656. ctx_ context.Context
  6657. header_ http.Header
  6658. }
  6659. // Update: Adds or updates an entitlement to an app for a user.
  6660. func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall {
  6661. c := &EntitlementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6662. c.enterpriseId = enterpriseId
  6663. c.userId = userId
  6664. c.entitlementId = entitlementId
  6665. c.entitlement = entitlement
  6666. return c
  6667. }
  6668. // Install sets the optional parameter "install": Set to true to also
  6669. // install the product on all the user's devices where possible. Failure
  6670. // to install on one or more devices will not prevent this operation
  6671. // from returning successfully, as long as the entitlement was
  6672. // successfully assigned to the user.
  6673. func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall {
  6674. c.urlParams_.Set("install", fmt.Sprint(install))
  6675. return c
  6676. }
  6677. // Fields allows partial responses to be retrieved. See
  6678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6679. // for more information.
  6680. func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall {
  6681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6682. return c
  6683. }
  6684. // Context sets the context to be used in this call's Do method. Any
  6685. // pending HTTP request will be aborted if the provided context is
  6686. // canceled.
  6687. func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall {
  6688. c.ctx_ = ctx
  6689. return c
  6690. }
  6691. // Header returns an http.Header that can be modified by the caller to
  6692. // add HTTP headers to the request.
  6693. func (c *EntitlementsUpdateCall) Header() http.Header {
  6694. if c.header_ == nil {
  6695. c.header_ = make(http.Header)
  6696. }
  6697. return c.header_
  6698. }
  6699. func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6700. reqHeaders := make(http.Header)
  6701. for k, v := range c.header_ {
  6702. reqHeaders[k] = v
  6703. }
  6704. reqHeaders.Set("User-Agent", c.s.userAgent())
  6705. var body io.Reader = nil
  6706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
  6707. if err != nil {
  6708. return nil, err
  6709. }
  6710. reqHeaders.Set("Content-Type", "application/json")
  6711. c.urlParams_.Set("alt", alt)
  6712. c.urlParams_.Set("prettyPrint", "false")
  6713. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6714. urls += "?" + c.urlParams_.Encode()
  6715. req, err := http.NewRequest("PUT", urls, body)
  6716. if err != nil {
  6717. return nil, err
  6718. }
  6719. req.Header = reqHeaders
  6720. googleapi.Expand(req.URL, map[string]string{
  6721. "enterpriseId": c.enterpriseId,
  6722. "userId": c.userId,
  6723. "entitlementId": c.entitlementId,
  6724. })
  6725. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6726. }
  6727. // Do executes the "androidenterprise.entitlements.update" call.
  6728. // Exactly one of *Entitlement or error will be non-nil. Any non-2xx
  6729. // status code is an error. Response headers are in either
  6730. // *Entitlement.ServerResponse.Header or (if a response was returned at
  6731. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6732. // to check whether the returned error was because
  6733. // http.StatusNotModified was returned.
  6734. func (c *EntitlementsUpdateCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
  6735. gensupport.SetOptions(c.urlParams_, opts...)
  6736. res, err := c.doRequest("json")
  6737. if res != nil && res.StatusCode == http.StatusNotModified {
  6738. if res.Body != nil {
  6739. res.Body.Close()
  6740. }
  6741. return nil, &googleapi.Error{
  6742. Code: res.StatusCode,
  6743. Header: res.Header,
  6744. }
  6745. }
  6746. if err != nil {
  6747. return nil, err
  6748. }
  6749. defer googleapi.CloseBody(res)
  6750. if err := googleapi.CheckResponse(res); err != nil {
  6751. return nil, err
  6752. }
  6753. ret := &Entitlement{
  6754. ServerResponse: googleapi.ServerResponse{
  6755. Header: res.Header,
  6756. HTTPStatusCode: res.StatusCode,
  6757. },
  6758. }
  6759. target := &ret
  6760. if err := gensupport.DecodeResponse(target, res); err != nil {
  6761. return nil, err
  6762. }
  6763. return ret, nil
  6764. // {
  6765. // "description": "Adds or updates an entitlement to an app for a user.",
  6766. // "httpMethod": "PUT",
  6767. // "id": "androidenterprise.entitlements.update",
  6768. // "parameterOrder": [
  6769. // "enterpriseId",
  6770. // "userId",
  6771. // "entitlementId"
  6772. // ],
  6773. // "parameters": {
  6774. // "enterpriseId": {
  6775. // "description": "The ID of the enterprise.",
  6776. // "location": "path",
  6777. // "required": true,
  6778. // "type": "string"
  6779. // },
  6780. // "entitlementId": {
  6781. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6782. // "location": "path",
  6783. // "required": true,
  6784. // "type": "string"
  6785. // },
  6786. // "install": {
  6787. // "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.",
  6788. // "location": "query",
  6789. // "type": "boolean"
  6790. // },
  6791. // "userId": {
  6792. // "description": "The ID of the user.",
  6793. // "location": "path",
  6794. // "required": true,
  6795. // "type": "string"
  6796. // }
  6797. // },
  6798. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6799. // "request": {
  6800. // "$ref": "Entitlement"
  6801. // },
  6802. // "response": {
  6803. // "$ref": "Entitlement"
  6804. // },
  6805. // "scopes": [
  6806. // "https://www.googleapis.com/auth/androidenterprise"
  6807. // ]
  6808. // }
  6809. }
  6810. // method id "androidenterprise.grouplicenses.get":
  6811. type GrouplicensesGetCall struct {
  6812. s *Service
  6813. enterpriseId string
  6814. groupLicenseId string
  6815. urlParams_ gensupport.URLParams
  6816. ifNoneMatch_ string
  6817. ctx_ context.Context
  6818. header_ http.Header
  6819. }
  6820. // Get: Retrieves details of an enterprise's group license for a
  6821. // product.
  6822. func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall {
  6823. c := &GrouplicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6824. c.enterpriseId = enterpriseId
  6825. c.groupLicenseId = groupLicenseId
  6826. return c
  6827. }
  6828. // Fields allows partial responses to be retrieved. See
  6829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6830. // for more information.
  6831. func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall {
  6832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6833. return c
  6834. }
  6835. // IfNoneMatch sets the optional parameter which makes the operation
  6836. // fail if the object's ETag matches the given value. This is useful for
  6837. // getting updates only after the object has changed since the last
  6838. // request. Use googleapi.IsNotModified to check whether the response
  6839. // error from Do is the result of In-None-Match.
  6840. func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall {
  6841. c.ifNoneMatch_ = entityTag
  6842. return c
  6843. }
  6844. // Context sets the context to be used in this call's Do method. Any
  6845. // pending HTTP request will be aborted if the provided context is
  6846. // canceled.
  6847. func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall {
  6848. c.ctx_ = ctx
  6849. return c
  6850. }
  6851. // Header returns an http.Header that can be modified by the caller to
  6852. // add HTTP headers to the request.
  6853. func (c *GrouplicensesGetCall) Header() http.Header {
  6854. if c.header_ == nil {
  6855. c.header_ = make(http.Header)
  6856. }
  6857. return c.header_
  6858. }
  6859. func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) {
  6860. reqHeaders := make(http.Header)
  6861. for k, v := range c.header_ {
  6862. reqHeaders[k] = v
  6863. }
  6864. reqHeaders.Set("User-Agent", c.s.userAgent())
  6865. if c.ifNoneMatch_ != "" {
  6866. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6867. }
  6868. var body io.Reader = nil
  6869. c.urlParams_.Set("alt", alt)
  6870. c.urlParams_.Set("prettyPrint", "false")
  6871. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}")
  6872. urls += "?" + c.urlParams_.Encode()
  6873. req, err := http.NewRequest("GET", urls, body)
  6874. if err != nil {
  6875. return nil, err
  6876. }
  6877. req.Header = reqHeaders
  6878. googleapi.Expand(req.URL, map[string]string{
  6879. "enterpriseId": c.enterpriseId,
  6880. "groupLicenseId": c.groupLicenseId,
  6881. })
  6882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6883. }
  6884. // Do executes the "androidenterprise.grouplicenses.get" call.
  6885. // Exactly one of *GroupLicense or error will be non-nil. Any non-2xx
  6886. // status code is an error. Response headers are in either
  6887. // *GroupLicense.ServerResponse.Header or (if a response was returned at
  6888. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6889. // to check whether the returned error was because
  6890. // http.StatusNotModified was returned.
  6891. func (c *GrouplicensesGetCall) Do(opts ...googleapi.CallOption) (*GroupLicense, error) {
  6892. gensupport.SetOptions(c.urlParams_, opts...)
  6893. res, err := c.doRequest("json")
  6894. if res != nil && res.StatusCode == http.StatusNotModified {
  6895. if res.Body != nil {
  6896. res.Body.Close()
  6897. }
  6898. return nil, &googleapi.Error{
  6899. Code: res.StatusCode,
  6900. Header: res.Header,
  6901. }
  6902. }
  6903. if err != nil {
  6904. return nil, err
  6905. }
  6906. defer googleapi.CloseBody(res)
  6907. if err := googleapi.CheckResponse(res); err != nil {
  6908. return nil, err
  6909. }
  6910. ret := &GroupLicense{
  6911. ServerResponse: googleapi.ServerResponse{
  6912. Header: res.Header,
  6913. HTTPStatusCode: res.StatusCode,
  6914. },
  6915. }
  6916. target := &ret
  6917. if err := gensupport.DecodeResponse(target, res); err != nil {
  6918. return nil, err
  6919. }
  6920. return ret, nil
  6921. // {
  6922. // "description": "Retrieves details of an enterprise's group license for a product.",
  6923. // "httpMethod": "GET",
  6924. // "id": "androidenterprise.grouplicenses.get",
  6925. // "parameterOrder": [
  6926. // "enterpriseId",
  6927. // "groupLicenseId"
  6928. // ],
  6929. // "parameters": {
  6930. // "enterpriseId": {
  6931. // "description": "The ID of the enterprise.",
  6932. // "location": "path",
  6933. // "required": true,
  6934. // "type": "string"
  6935. // },
  6936. // "groupLicenseId": {
  6937. // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
  6938. // "location": "path",
  6939. // "required": true,
  6940. // "type": "string"
  6941. // }
  6942. // },
  6943. // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}",
  6944. // "response": {
  6945. // "$ref": "GroupLicense"
  6946. // },
  6947. // "scopes": [
  6948. // "https://www.googleapis.com/auth/androidenterprise"
  6949. // ]
  6950. // }
  6951. }
  6952. // method id "androidenterprise.grouplicenses.list":
  6953. type GrouplicensesListCall struct {
  6954. s *Service
  6955. enterpriseId string
  6956. urlParams_ gensupport.URLParams
  6957. ifNoneMatch_ string
  6958. ctx_ context.Context
  6959. header_ http.Header
  6960. }
  6961. // List: Retrieves IDs of all products for which the enterprise has a
  6962. // group license.
  6963. func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall {
  6964. c := &GrouplicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6965. c.enterpriseId = enterpriseId
  6966. return c
  6967. }
  6968. // Fields allows partial responses to be retrieved. See
  6969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6970. // for more information.
  6971. func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall {
  6972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6973. return c
  6974. }
  6975. // IfNoneMatch sets the optional parameter which makes the operation
  6976. // fail if the object's ETag matches the given value. This is useful for
  6977. // getting updates only after the object has changed since the last
  6978. // request. Use googleapi.IsNotModified to check whether the response
  6979. // error from Do is the result of In-None-Match.
  6980. func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall {
  6981. c.ifNoneMatch_ = entityTag
  6982. return c
  6983. }
  6984. // Context sets the context to be used in this call's Do method. Any
  6985. // pending HTTP request will be aborted if the provided context is
  6986. // canceled.
  6987. func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall {
  6988. c.ctx_ = ctx
  6989. return c
  6990. }
  6991. // Header returns an http.Header that can be modified by the caller to
  6992. // add HTTP headers to the request.
  6993. func (c *GrouplicensesListCall) Header() http.Header {
  6994. if c.header_ == nil {
  6995. c.header_ = make(http.Header)
  6996. }
  6997. return c.header_
  6998. }
  6999. func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) {
  7000. reqHeaders := make(http.Header)
  7001. for k, v := range c.header_ {
  7002. reqHeaders[k] = v
  7003. }
  7004. reqHeaders.Set("User-Agent", c.s.userAgent())
  7005. if c.ifNoneMatch_ != "" {
  7006. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7007. }
  7008. var body io.Reader = nil
  7009. c.urlParams_.Set("alt", alt)
  7010. c.urlParams_.Set("prettyPrint", "false")
  7011. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses")
  7012. urls += "?" + c.urlParams_.Encode()
  7013. req, err := http.NewRequest("GET", urls, body)
  7014. if err != nil {
  7015. return nil, err
  7016. }
  7017. req.Header = reqHeaders
  7018. googleapi.Expand(req.URL, map[string]string{
  7019. "enterpriseId": c.enterpriseId,
  7020. })
  7021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7022. }
  7023. // Do executes the "androidenterprise.grouplicenses.list" call.
  7024. // Exactly one of *GroupLicensesListResponse or error will be non-nil.
  7025. // Any non-2xx status code is an error. Response headers are in either
  7026. // *GroupLicensesListResponse.ServerResponse.Header or (if a response
  7027. // was returned at all) in error.(*googleapi.Error).Header. Use
  7028. // googleapi.IsNotModified to check whether the returned error was
  7029. // because http.StatusNotModified was returned.
  7030. func (c *GrouplicensesListCall) Do(opts ...googleapi.CallOption) (*GroupLicensesListResponse, error) {
  7031. gensupport.SetOptions(c.urlParams_, opts...)
  7032. res, err := c.doRequest("json")
  7033. if res != nil && res.StatusCode == http.StatusNotModified {
  7034. if res.Body != nil {
  7035. res.Body.Close()
  7036. }
  7037. return nil, &googleapi.Error{
  7038. Code: res.StatusCode,
  7039. Header: res.Header,
  7040. }
  7041. }
  7042. if err != nil {
  7043. return nil, err
  7044. }
  7045. defer googleapi.CloseBody(res)
  7046. if err := googleapi.CheckResponse(res); err != nil {
  7047. return nil, err
  7048. }
  7049. ret := &GroupLicensesListResponse{
  7050. ServerResponse: googleapi.ServerResponse{
  7051. Header: res.Header,
  7052. HTTPStatusCode: res.StatusCode,
  7053. },
  7054. }
  7055. target := &ret
  7056. if err := gensupport.DecodeResponse(target, res); err != nil {
  7057. return nil, err
  7058. }
  7059. return ret, nil
  7060. // {
  7061. // "description": "Retrieves IDs of all products for which the enterprise has a group license.",
  7062. // "httpMethod": "GET",
  7063. // "id": "androidenterprise.grouplicenses.list",
  7064. // "parameterOrder": [
  7065. // "enterpriseId"
  7066. // ],
  7067. // "parameters": {
  7068. // "enterpriseId": {
  7069. // "description": "The ID of the enterprise.",
  7070. // "location": "path",
  7071. // "required": true,
  7072. // "type": "string"
  7073. // }
  7074. // },
  7075. // "path": "enterprises/{enterpriseId}/groupLicenses",
  7076. // "response": {
  7077. // "$ref": "GroupLicensesListResponse"
  7078. // },
  7079. // "scopes": [
  7080. // "https://www.googleapis.com/auth/androidenterprise"
  7081. // ]
  7082. // }
  7083. }
  7084. // method id "androidenterprise.grouplicenseusers.list":
  7085. type GrouplicenseusersListCall struct {
  7086. s *Service
  7087. enterpriseId string
  7088. groupLicenseId string
  7089. urlParams_ gensupport.URLParams
  7090. ifNoneMatch_ string
  7091. ctx_ context.Context
  7092. header_ http.Header
  7093. }
  7094. // List: Retrieves the IDs of the users who have been granted
  7095. // entitlements under the license.
  7096. func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall {
  7097. c := &GrouplicenseusersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7098. c.enterpriseId = enterpriseId
  7099. c.groupLicenseId = groupLicenseId
  7100. return c
  7101. }
  7102. // Fields allows partial responses to be retrieved. See
  7103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7104. // for more information.
  7105. func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall {
  7106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7107. return c
  7108. }
  7109. // IfNoneMatch sets the optional parameter which makes the operation
  7110. // fail if the object's ETag matches the given value. This is useful for
  7111. // getting updates only after the object has changed since the last
  7112. // request. Use googleapi.IsNotModified to check whether the response
  7113. // error from Do is the result of In-None-Match.
  7114. func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall {
  7115. c.ifNoneMatch_ = entityTag
  7116. return c
  7117. }
  7118. // Context sets the context to be used in this call's Do method. Any
  7119. // pending HTTP request will be aborted if the provided context is
  7120. // canceled.
  7121. func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall {
  7122. c.ctx_ = ctx
  7123. return c
  7124. }
  7125. // Header returns an http.Header that can be modified by the caller to
  7126. // add HTTP headers to the request.
  7127. func (c *GrouplicenseusersListCall) Header() http.Header {
  7128. if c.header_ == nil {
  7129. c.header_ = make(http.Header)
  7130. }
  7131. return c.header_
  7132. }
  7133. func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) {
  7134. reqHeaders := make(http.Header)
  7135. for k, v := range c.header_ {
  7136. reqHeaders[k] = v
  7137. }
  7138. reqHeaders.Set("User-Agent", c.s.userAgent())
  7139. if c.ifNoneMatch_ != "" {
  7140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7141. }
  7142. var body io.Reader = nil
  7143. c.urlParams_.Set("alt", alt)
  7144. c.urlParams_.Set("prettyPrint", "false")
  7145. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users")
  7146. urls += "?" + c.urlParams_.Encode()
  7147. req, err := http.NewRequest("GET", urls, body)
  7148. if err != nil {
  7149. return nil, err
  7150. }
  7151. req.Header = reqHeaders
  7152. googleapi.Expand(req.URL, map[string]string{
  7153. "enterpriseId": c.enterpriseId,
  7154. "groupLicenseId": c.groupLicenseId,
  7155. })
  7156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7157. }
  7158. // Do executes the "androidenterprise.grouplicenseusers.list" call.
  7159. // Exactly one of *GroupLicenseUsersListResponse or error will be
  7160. // non-nil. Any non-2xx status code is an error. Response headers are in
  7161. // either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a
  7162. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7163. // googleapi.IsNotModified to check whether the returned error was
  7164. // because http.StatusNotModified was returned.
  7165. func (c *GrouplicenseusersListCall) Do(opts ...googleapi.CallOption) (*GroupLicenseUsersListResponse, error) {
  7166. gensupport.SetOptions(c.urlParams_, opts...)
  7167. res, err := c.doRequest("json")
  7168. if res != nil && res.StatusCode == http.StatusNotModified {
  7169. if res.Body != nil {
  7170. res.Body.Close()
  7171. }
  7172. return nil, &googleapi.Error{
  7173. Code: res.StatusCode,
  7174. Header: res.Header,
  7175. }
  7176. }
  7177. if err != nil {
  7178. return nil, err
  7179. }
  7180. defer googleapi.CloseBody(res)
  7181. if err := googleapi.CheckResponse(res); err != nil {
  7182. return nil, err
  7183. }
  7184. ret := &GroupLicenseUsersListResponse{
  7185. ServerResponse: googleapi.ServerResponse{
  7186. Header: res.Header,
  7187. HTTPStatusCode: res.StatusCode,
  7188. },
  7189. }
  7190. target := &ret
  7191. if err := gensupport.DecodeResponse(target, res); err != nil {
  7192. return nil, err
  7193. }
  7194. return ret, nil
  7195. // {
  7196. // "description": "Retrieves the IDs of the users who have been granted entitlements under the license.",
  7197. // "httpMethod": "GET",
  7198. // "id": "androidenterprise.grouplicenseusers.list",
  7199. // "parameterOrder": [
  7200. // "enterpriseId",
  7201. // "groupLicenseId"
  7202. // ],
  7203. // "parameters": {
  7204. // "enterpriseId": {
  7205. // "description": "The ID of the enterprise.",
  7206. // "location": "path",
  7207. // "required": true,
  7208. // "type": "string"
  7209. // },
  7210. // "groupLicenseId": {
  7211. // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
  7212. // "location": "path",
  7213. // "required": true,
  7214. // "type": "string"
  7215. // }
  7216. // },
  7217. // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users",
  7218. // "response": {
  7219. // "$ref": "GroupLicenseUsersListResponse"
  7220. // },
  7221. // "scopes": [
  7222. // "https://www.googleapis.com/auth/androidenterprise"
  7223. // ]
  7224. // }
  7225. }
  7226. // method id "androidenterprise.installs.delete":
  7227. type InstallsDeleteCall struct {
  7228. s *Service
  7229. enterpriseId string
  7230. userId string
  7231. deviceId string
  7232. installId string
  7233. urlParams_ gensupport.URLParams
  7234. ctx_ context.Context
  7235. header_ http.Header
  7236. }
  7237. // Delete: Requests to remove an app from a device. A call to get or
  7238. // list will still show the app as installed on the device until it is
  7239. // actually removed.
  7240. func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall {
  7241. c := &InstallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7242. c.enterpriseId = enterpriseId
  7243. c.userId = userId
  7244. c.deviceId = deviceId
  7245. c.installId = installId
  7246. return c
  7247. }
  7248. // Fields allows partial responses to be retrieved. See
  7249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7250. // for more information.
  7251. func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall {
  7252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7253. return c
  7254. }
  7255. // Context sets the context to be used in this call's Do method. Any
  7256. // pending HTTP request will be aborted if the provided context is
  7257. // canceled.
  7258. func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall {
  7259. c.ctx_ = ctx
  7260. return c
  7261. }
  7262. // Header returns an http.Header that can be modified by the caller to
  7263. // add HTTP headers to the request.
  7264. func (c *InstallsDeleteCall) Header() http.Header {
  7265. if c.header_ == nil {
  7266. c.header_ = make(http.Header)
  7267. }
  7268. return c.header_
  7269. }
  7270. func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7271. reqHeaders := make(http.Header)
  7272. for k, v := range c.header_ {
  7273. reqHeaders[k] = v
  7274. }
  7275. reqHeaders.Set("User-Agent", c.s.userAgent())
  7276. var body io.Reader = nil
  7277. c.urlParams_.Set("alt", alt)
  7278. c.urlParams_.Set("prettyPrint", "false")
  7279. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7280. urls += "?" + c.urlParams_.Encode()
  7281. req, err := http.NewRequest("DELETE", urls, body)
  7282. if err != nil {
  7283. return nil, err
  7284. }
  7285. req.Header = reqHeaders
  7286. googleapi.Expand(req.URL, map[string]string{
  7287. "enterpriseId": c.enterpriseId,
  7288. "userId": c.userId,
  7289. "deviceId": c.deviceId,
  7290. "installId": c.installId,
  7291. })
  7292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7293. }
  7294. // Do executes the "androidenterprise.installs.delete" call.
  7295. func (c *InstallsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7296. gensupport.SetOptions(c.urlParams_, opts...)
  7297. res, err := c.doRequest("json")
  7298. if err != nil {
  7299. return err
  7300. }
  7301. defer googleapi.CloseBody(res)
  7302. if err := googleapi.CheckResponse(res); err != nil {
  7303. return err
  7304. }
  7305. return nil
  7306. // {
  7307. // "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.",
  7308. // "httpMethod": "DELETE",
  7309. // "id": "androidenterprise.installs.delete",
  7310. // "parameterOrder": [
  7311. // "enterpriseId",
  7312. // "userId",
  7313. // "deviceId",
  7314. // "installId"
  7315. // ],
  7316. // "parameters": {
  7317. // "deviceId": {
  7318. // "description": "The Android ID of the device.",
  7319. // "location": "path",
  7320. // "required": true,
  7321. // "type": "string"
  7322. // },
  7323. // "enterpriseId": {
  7324. // "description": "The ID of the enterprise.",
  7325. // "location": "path",
  7326. // "required": true,
  7327. // "type": "string"
  7328. // },
  7329. // "installId": {
  7330. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7331. // "location": "path",
  7332. // "required": true,
  7333. // "type": "string"
  7334. // },
  7335. // "userId": {
  7336. // "description": "The ID of the user.",
  7337. // "location": "path",
  7338. // "required": true,
  7339. // "type": "string"
  7340. // }
  7341. // },
  7342. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7343. // "scopes": [
  7344. // "https://www.googleapis.com/auth/androidenterprise"
  7345. // ]
  7346. // }
  7347. }
  7348. // method id "androidenterprise.installs.get":
  7349. type InstallsGetCall struct {
  7350. s *Service
  7351. enterpriseId string
  7352. userId string
  7353. deviceId string
  7354. installId string
  7355. urlParams_ gensupport.URLParams
  7356. ifNoneMatch_ string
  7357. ctx_ context.Context
  7358. header_ http.Header
  7359. }
  7360. // Get: Retrieves details of an installation of an app on a device.
  7361. func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall {
  7362. c := &InstallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7363. c.enterpriseId = enterpriseId
  7364. c.userId = userId
  7365. c.deviceId = deviceId
  7366. c.installId = installId
  7367. return c
  7368. }
  7369. // Fields allows partial responses to be retrieved. See
  7370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7371. // for more information.
  7372. func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall {
  7373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7374. return c
  7375. }
  7376. // IfNoneMatch sets the optional parameter which makes the operation
  7377. // fail if the object's ETag matches the given value. This is useful for
  7378. // getting updates only after the object has changed since the last
  7379. // request. Use googleapi.IsNotModified to check whether the response
  7380. // error from Do is the result of In-None-Match.
  7381. func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall {
  7382. c.ifNoneMatch_ = entityTag
  7383. return c
  7384. }
  7385. // Context sets the context to be used in this call's Do method. Any
  7386. // pending HTTP request will be aborted if the provided context is
  7387. // canceled.
  7388. func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall {
  7389. c.ctx_ = ctx
  7390. return c
  7391. }
  7392. // Header returns an http.Header that can be modified by the caller to
  7393. // add HTTP headers to the request.
  7394. func (c *InstallsGetCall) Header() http.Header {
  7395. if c.header_ == nil {
  7396. c.header_ = make(http.Header)
  7397. }
  7398. return c.header_
  7399. }
  7400. func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) {
  7401. reqHeaders := make(http.Header)
  7402. for k, v := range c.header_ {
  7403. reqHeaders[k] = v
  7404. }
  7405. reqHeaders.Set("User-Agent", c.s.userAgent())
  7406. if c.ifNoneMatch_ != "" {
  7407. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7408. }
  7409. var body io.Reader = nil
  7410. c.urlParams_.Set("alt", alt)
  7411. c.urlParams_.Set("prettyPrint", "false")
  7412. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7413. urls += "?" + c.urlParams_.Encode()
  7414. req, err := http.NewRequest("GET", urls, body)
  7415. if err != nil {
  7416. return nil, err
  7417. }
  7418. req.Header = reqHeaders
  7419. googleapi.Expand(req.URL, map[string]string{
  7420. "enterpriseId": c.enterpriseId,
  7421. "userId": c.userId,
  7422. "deviceId": c.deviceId,
  7423. "installId": c.installId,
  7424. })
  7425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7426. }
  7427. // Do executes the "androidenterprise.installs.get" call.
  7428. // Exactly one of *Install or error will be non-nil. Any non-2xx status
  7429. // code is an error. Response headers are in either
  7430. // *Install.ServerResponse.Header or (if a response was returned at all)
  7431. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7432. // check whether the returned error was because http.StatusNotModified
  7433. // was returned.
  7434. func (c *InstallsGetCall) Do(opts ...googleapi.CallOption) (*Install, error) {
  7435. gensupport.SetOptions(c.urlParams_, opts...)
  7436. res, err := c.doRequest("json")
  7437. if res != nil && res.StatusCode == http.StatusNotModified {
  7438. if res.Body != nil {
  7439. res.Body.Close()
  7440. }
  7441. return nil, &googleapi.Error{
  7442. Code: res.StatusCode,
  7443. Header: res.Header,
  7444. }
  7445. }
  7446. if err != nil {
  7447. return nil, err
  7448. }
  7449. defer googleapi.CloseBody(res)
  7450. if err := googleapi.CheckResponse(res); err != nil {
  7451. return nil, err
  7452. }
  7453. ret := &Install{
  7454. ServerResponse: googleapi.ServerResponse{
  7455. Header: res.Header,
  7456. HTTPStatusCode: res.StatusCode,
  7457. },
  7458. }
  7459. target := &ret
  7460. if err := gensupport.DecodeResponse(target, res); err != nil {
  7461. return nil, err
  7462. }
  7463. return ret, nil
  7464. // {
  7465. // "description": "Retrieves details of an installation of an app on a device.",
  7466. // "httpMethod": "GET",
  7467. // "id": "androidenterprise.installs.get",
  7468. // "parameterOrder": [
  7469. // "enterpriseId",
  7470. // "userId",
  7471. // "deviceId",
  7472. // "installId"
  7473. // ],
  7474. // "parameters": {
  7475. // "deviceId": {
  7476. // "description": "The Android ID of the device.",
  7477. // "location": "path",
  7478. // "required": true,
  7479. // "type": "string"
  7480. // },
  7481. // "enterpriseId": {
  7482. // "description": "The ID of the enterprise.",
  7483. // "location": "path",
  7484. // "required": true,
  7485. // "type": "string"
  7486. // },
  7487. // "installId": {
  7488. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7489. // "location": "path",
  7490. // "required": true,
  7491. // "type": "string"
  7492. // },
  7493. // "userId": {
  7494. // "description": "The ID of the user.",
  7495. // "location": "path",
  7496. // "required": true,
  7497. // "type": "string"
  7498. // }
  7499. // },
  7500. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7501. // "response": {
  7502. // "$ref": "Install"
  7503. // },
  7504. // "scopes": [
  7505. // "https://www.googleapis.com/auth/androidenterprise"
  7506. // ]
  7507. // }
  7508. }
  7509. // method id "androidenterprise.installs.list":
  7510. type InstallsListCall struct {
  7511. s *Service
  7512. enterpriseId string
  7513. userId string
  7514. deviceId string
  7515. urlParams_ gensupport.URLParams
  7516. ifNoneMatch_ string
  7517. ctx_ context.Context
  7518. header_ http.Header
  7519. }
  7520. // List: Retrieves the details of all apps installed on the specified
  7521. // device.
  7522. func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall {
  7523. c := &InstallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7524. c.enterpriseId = enterpriseId
  7525. c.userId = userId
  7526. c.deviceId = deviceId
  7527. return c
  7528. }
  7529. // Fields allows partial responses to be retrieved. See
  7530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7531. // for more information.
  7532. func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall {
  7533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7534. return c
  7535. }
  7536. // IfNoneMatch sets the optional parameter which makes the operation
  7537. // fail if the object's ETag matches the given value. This is useful for
  7538. // getting updates only after the object has changed since the last
  7539. // request. Use googleapi.IsNotModified to check whether the response
  7540. // error from Do is the result of In-None-Match.
  7541. func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall {
  7542. c.ifNoneMatch_ = entityTag
  7543. return c
  7544. }
  7545. // Context sets the context to be used in this call's Do method. Any
  7546. // pending HTTP request will be aborted if the provided context is
  7547. // canceled.
  7548. func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall {
  7549. c.ctx_ = ctx
  7550. return c
  7551. }
  7552. // Header returns an http.Header that can be modified by the caller to
  7553. // add HTTP headers to the request.
  7554. func (c *InstallsListCall) Header() http.Header {
  7555. if c.header_ == nil {
  7556. c.header_ = make(http.Header)
  7557. }
  7558. return c.header_
  7559. }
  7560. func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) {
  7561. reqHeaders := make(http.Header)
  7562. for k, v := range c.header_ {
  7563. reqHeaders[k] = v
  7564. }
  7565. reqHeaders.Set("User-Agent", c.s.userAgent())
  7566. if c.ifNoneMatch_ != "" {
  7567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7568. }
  7569. var body io.Reader = nil
  7570. c.urlParams_.Set("alt", alt)
  7571. c.urlParams_.Set("prettyPrint", "false")
  7572. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs")
  7573. urls += "?" + c.urlParams_.Encode()
  7574. req, err := http.NewRequest("GET", urls, body)
  7575. if err != nil {
  7576. return nil, err
  7577. }
  7578. req.Header = reqHeaders
  7579. googleapi.Expand(req.URL, map[string]string{
  7580. "enterpriseId": c.enterpriseId,
  7581. "userId": c.userId,
  7582. "deviceId": c.deviceId,
  7583. })
  7584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7585. }
  7586. // Do executes the "androidenterprise.installs.list" call.
  7587. // Exactly one of *InstallsListResponse or error will be non-nil. Any
  7588. // non-2xx status code is an error. Response headers are in either
  7589. // *InstallsListResponse.ServerResponse.Header or (if a response was
  7590. // returned at all) in error.(*googleapi.Error).Header. Use
  7591. // googleapi.IsNotModified to check whether the returned error was
  7592. // because http.StatusNotModified was returned.
  7593. func (c *InstallsListCall) Do(opts ...googleapi.CallOption) (*InstallsListResponse, error) {
  7594. gensupport.SetOptions(c.urlParams_, opts...)
  7595. res, err := c.doRequest("json")
  7596. if res != nil && res.StatusCode == http.StatusNotModified {
  7597. if res.Body != nil {
  7598. res.Body.Close()
  7599. }
  7600. return nil, &googleapi.Error{
  7601. Code: res.StatusCode,
  7602. Header: res.Header,
  7603. }
  7604. }
  7605. if err != nil {
  7606. return nil, err
  7607. }
  7608. defer googleapi.CloseBody(res)
  7609. if err := googleapi.CheckResponse(res); err != nil {
  7610. return nil, err
  7611. }
  7612. ret := &InstallsListResponse{
  7613. ServerResponse: googleapi.ServerResponse{
  7614. Header: res.Header,
  7615. HTTPStatusCode: res.StatusCode,
  7616. },
  7617. }
  7618. target := &ret
  7619. if err := gensupport.DecodeResponse(target, res); err != nil {
  7620. return nil, err
  7621. }
  7622. return ret, nil
  7623. // {
  7624. // "description": "Retrieves the details of all apps installed on the specified device.",
  7625. // "httpMethod": "GET",
  7626. // "id": "androidenterprise.installs.list",
  7627. // "parameterOrder": [
  7628. // "enterpriseId",
  7629. // "userId",
  7630. // "deviceId"
  7631. // ],
  7632. // "parameters": {
  7633. // "deviceId": {
  7634. // "description": "The Android ID of the device.",
  7635. // "location": "path",
  7636. // "required": true,
  7637. // "type": "string"
  7638. // },
  7639. // "enterpriseId": {
  7640. // "description": "The ID of the enterprise.",
  7641. // "location": "path",
  7642. // "required": true,
  7643. // "type": "string"
  7644. // },
  7645. // "userId": {
  7646. // "description": "The ID of the user.",
  7647. // "location": "path",
  7648. // "required": true,
  7649. // "type": "string"
  7650. // }
  7651. // },
  7652. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs",
  7653. // "response": {
  7654. // "$ref": "InstallsListResponse"
  7655. // },
  7656. // "scopes": [
  7657. // "https://www.googleapis.com/auth/androidenterprise"
  7658. // ]
  7659. // }
  7660. }
  7661. // method id "androidenterprise.installs.patch":
  7662. type InstallsPatchCall struct {
  7663. s *Service
  7664. enterpriseId string
  7665. userId string
  7666. deviceId string
  7667. installId string
  7668. install *Install
  7669. urlParams_ gensupport.URLParams
  7670. ctx_ context.Context
  7671. header_ http.Header
  7672. }
  7673. // Patch: Requests to install the latest version of an app to a device.
  7674. // If the app is already installed, then it is updated to the latest
  7675. // version if necessary. This method supports patch semantics.
  7676. func (r *InstallsService) Patch(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsPatchCall {
  7677. c := &InstallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7678. c.enterpriseId = enterpriseId
  7679. c.userId = userId
  7680. c.deviceId = deviceId
  7681. c.installId = installId
  7682. c.install = install
  7683. return c
  7684. }
  7685. // Fields allows partial responses to be retrieved. See
  7686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7687. // for more information.
  7688. func (c *InstallsPatchCall) Fields(s ...googleapi.Field) *InstallsPatchCall {
  7689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7690. return c
  7691. }
  7692. // Context sets the context to be used in this call's Do method. Any
  7693. // pending HTTP request will be aborted if the provided context is
  7694. // canceled.
  7695. func (c *InstallsPatchCall) Context(ctx context.Context) *InstallsPatchCall {
  7696. c.ctx_ = ctx
  7697. return c
  7698. }
  7699. // Header returns an http.Header that can be modified by the caller to
  7700. // add HTTP headers to the request.
  7701. func (c *InstallsPatchCall) Header() http.Header {
  7702. if c.header_ == nil {
  7703. c.header_ = make(http.Header)
  7704. }
  7705. return c.header_
  7706. }
  7707. func (c *InstallsPatchCall) doRequest(alt string) (*http.Response, error) {
  7708. reqHeaders := make(http.Header)
  7709. for k, v := range c.header_ {
  7710. reqHeaders[k] = v
  7711. }
  7712. reqHeaders.Set("User-Agent", c.s.userAgent())
  7713. var body io.Reader = nil
  7714. body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
  7715. if err != nil {
  7716. return nil, err
  7717. }
  7718. reqHeaders.Set("Content-Type", "application/json")
  7719. c.urlParams_.Set("alt", alt)
  7720. c.urlParams_.Set("prettyPrint", "false")
  7721. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7722. urls += "?" + c.urlParams_.Encode()
  7723. req, err := http.NewRequest("PATCH", urls, body)
  7724. if err != nil {
  7725. return nil, err
  7726. }
  7727. req.Header = reqHeaders
  7728. googleapi.Expand(req.URL, map[string]string{
  7729. "enterpriseId": c.enterpriseId,
  7730. "userId": c.userId,
  7731. "deviceId": c.deviceId,
  7732. "installId": c.installId,
  7733. })
  7734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7735. }
  7736. // Do executes the "androidenterprise.installs.patch" call.
  7737. // Exactly one of *Install or error will be non-nil. Any non-2xx status
  7738. // code is an error. Response headers are in either
  7739. // *Install.ServerResponse.Header or (if a response was returned at all)
  7740. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7741. // check whether the returned error was because http.StatusNotModified
  7742. // was returned.
  7743. func (c *InstallsPatchCall) Do(opts ...googleapi.CallOption) (*Install, error) {
  7744. gensupport.SetOptions(c.urlParams_, opts...)
  7745. res, err := c.doRequest("json")
  7746. if res != nil && res.StatusCode == http.StatusNotModified {
  7747. if res.Body != nil {
  7748. res.Body.Close()
  7749. }
  7750. return nil, &googleapi.Error{
  7751. Code: res.StatusCode,
  7752. Header: res.Header,
  7753. }
  7754. }
  7755. if err != nil {
  7756. return nil, err
  7757. }
  7758. defer googleapi.CloseBody(res)
  7759. if err := googleapi.CheckResponse(res); err != nil {
  7760. return nil, err
  7761. }
  7762. ret := &Install{
  7763. ServerResponse: googleapi.ServerResponse{
  7764. Header: res.Header,
  7765. HTTPStatusCode: res.StatusCode,
  7766. },
  7767. }
  7768. target := &ret
  7769. if err := gensupport.DecodeResponse(target, res); err != nil {
  7770. return nil, err
  7771. }
  7772. return ret, nil
  7773. // {
  7774. // "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.",
  7775. // "httpMethod": "PATCH",
  7776. // "id": "androidenterprise.installs.patch",
  7777. // "parameterOrder": [
  7778. // "enterpriseId",
  7779. // "userId",
  7780. // "deviceId",
  7781. // "installId"
  7782. // ],
  7783. // "parameters": {
  7784. // "deviceId": {
  7785. // "description": "The Android ID of the device.",
  7786. // "location": "path",
  7787. // "required": true,
  7788. // "type": "string"
  7789. // },
  7790. // "enterpriseId": {
  7791. // "description": "The ID of the enterprise.",
  7792. // "location": "path",
  7793. // "required": true,
  7794. // "type": "string"
  7795. // },
  7796. // "installId": {
  7797. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7798. // "location": "path",
  7799. // "required": true,
  7800. // "type": "string"
  7801. // },
  7802. // "userId": {
  7803. // "description": "The ID of the user.",
  7804. // "location": "path",
  7805. // "required": true,
  7806. // "type": "string"
  7807. // }
  7808. // },
  7809. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7810. // "request": {
  7811. // "$ref": "Install"
  7812. // },
  7813. // "response": {
  7814. // "$ref": "Install"
  7815. // },
  7816. // "scopes": [
  7817. // "https://www.googleapis.com/auth/androidenterprise"
  7818. // ]
  7819. // }
  7820. }
  7821. // method id "androidenterprise.installs.update":
  7822. type InstallsUpdateCall struct {
  7823. s *Service
  7824. enterpriseId string
  7825. userId string
  7826. deviceId string
  7827. installId string
  7828. install *Install
  7829. urlParams_ gensupport.URLParams
  7830. ctx_ context.Context
  7831. header_ http.Header
  7832. }
  7833. // Update: Requests to install the latest version of an app to a device.
  7834. // If the app is already installed, then it is updated to the latest
  7835. // version if necessary.
  7836. func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall {
  7837. c := &InstallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7838. c.enterpriseId = enterpriseId
  7839. c.userId = userId
  7840. c.deviceId = deviceId
  7841. c.installId = installId
  7842. c.install = install
  7843. return c
  7844. }
  7845. // Fields allows partial responses to be retrieved. See
  7846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7847. // for more information.
  7848. func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall {
  7849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7850. return c
  7851. }
  7852. // Context sets the context to be used in this call's Do method. Any
  7853. // pending HTTP request will be aborted if the provided context is
  7854. // canceled.
  7855. func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall {
  7856. c.ctx_ = ctx
  7857. return c
  7858. }
  7859. // Header returns an http.Header that can be modified by the caller to
  7860. // add HTTP headers to the request.
  7861. func (c *InstallsUpdateCall) Header() http.Header {
  7862. if c.header_ == nil {
  7863. c.header_ = make(http.Header)
  7864. }
  7865. return c.header_
  7866. }
  7867. func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7868. reqHeaders := make(http.Header)
  7869. for k, v := range c.header_ {
  7870. reqHeaders[k] = v
  7871. }
  7872. reqHeaders.Set("User-Agent", c.s.userAgent())
  7873. var body io.Reader = nil
  7874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
  7875. if err != nil {
  7876. return nil, err
  7877. }
  7878. reqHeaders.Set("Content-Type", "application/json")
  7879. c.urlParams_.Set("alt", alt)
  7880. c.urlParams_.Set("prettyPrint", "false")
  7881. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7882. urls += "?" + c.urlParams_.Encode()
  7883. req, err := http.NewRequest("PUT", urls, body)
  7884. if err != nil {
  7885. return nil, err
  7886. }
  7887. req.Header = reqHeaders
  7888. googleapi.Expand(req.URL, map[string]string{
  7889. "enterpriseId": c.enterpriseId,
  7890. "userId": c.userId,
  7891. "deviceId": c.deviceId,
  7892. "installId": c.installId,
  7893. })
  7894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7895. }
  7896. // Do executes the "androidenterprise.installs.update" call.
  7897. // Exactly one of *Install or error will be non-nil. Any non-2xx status
  7898. // code is an error. Response headers are in either
  7899. // *Install.ServerResponse.Header or (if a response was returned at all)
  7900. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7901. // check whether the returned error was because http.StatusNotModified
  7902. // was returned.
  7903. func (c *InstallsUpdateCall) Do(opts ...googleapi.CallOption) (*Install, error) {
  7904. gensupport.SetOptions(c.urlParams_, opts...)
  7905. res, err := c.doRequest("json")
  7906. if res != nil && res.StatusCode == http.StatusNotModified {
  7907. if res.Body != nil {
  7908. res.Body.Close()
  7909. }
  7910. return nil, &googleapi.Error{
  7911. Code: res.StatusCode,
  7912. Header: res.Header,
  7913. }
  7914. }
  7915. if err != nil {
  7916. return nil, err
  7917. }
  7918. defer googleapi.CloseBody(res)
  7919. if err := googleapi.CheckResponse(res); err != nil {
  7920. return nil, err
  7921. }
  7922. ret := &Install{
  7923. ServerResponse: googleapi.ServerResponse{
  7924. Header: res.Header,
  7925. HTTPStatusCode: res.StatusCode,
  7926. },
  7927. }
  7928. target := &ret
  7929. if err := gensupport.DecodeResponse(target, res); err != nil {
  7930. return nil, err
  7931. }
  7932. return ret, nil
  7933. // {
  7934. // "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.",
  7935. // "httpMethod": "PUT",
  7936. // "id": "androidenterprise.installs.update",
  7937. // "parameterOrder": [
  7938. // "enterpriseId",
  7939. // "userId",
  7940. // "deviceId",
  7941. // "installId"
  7942. // ],
  7943. // "parameters": {
  7944. // "deviceId": {
  7945. // "description": "The Android ID of the device.",
  7946. // "location": "path",
  7947. // "required": true,
  7948. // "type": "string"
  7949. // },
  7950. // "enterpriseId": {
  7951. // "description": "The ID of the enterprise.",
  7952. // "location": "path",
  7953. // "required": true,
  7954. // "type": "string"
  7955. // },
  7956. // "installId": {
  7957. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7958. // "location": "path",
  7959. // "required": true,
  7960. // "type": "string"
  7961. // },
  7962. // "userId": {
  7963. // "description": "The ID of the user.",
  7964. // "location": "path",
  7965. // "required": true,
  7966. // "type": "string"
  7967. // }
  7968. // },
  7969. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7970. // "request": {
  7971. // "$ref": "Install"
  7972. // },
  7973. // "response": {
  7974. // "$ref": "Install"
  7975. // },
  7976. // "scopes": [
  7977. // "https://www.googleapis.com/auth/androidenterprise"
  7978. // ]
  7979. // }
  7980. }
  7981. // method id "androidenterprise.managedconfigurationsfordevice.delete":
  7982. type ManagedconfigurationsfordeviceDeleteCall struct {
  7983. s *Service
  7984. enterpriseId string
  7985. userId string
  7986. deviceId string
  7987. managedConfigurationForDeviceId string
  7988. urlParams_ gensupport.URLParams
  7989. ctx_ context.Context
  7990. header_ http.Header
  7991. }
  7992. // Delete: Removes a per-device managed configuration for an app for the
  7993. // specified device.
  7994. func (r *ManagedconfigurationsfordeviceService) Delete(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceDeleteCall {
  7995. c := &ManagedconfigurationsfordeviceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7996. c.enterpriseId = enterpriseId
  7997. c.userId = userId
  7998. c.deviceId = deviceId
  7999. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  8000. return c
  8001. }
  8002. // Fields allows partial responses to be retrieved. See
  8003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8004. // for more information.
  8005. func (c *ManagedconfigurationsfordeviceDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceDeleteCall {
  8006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8007. return c
  8008. }
  8009. // Context sets the context to be used in this call's Do method. Any
  8010. // pending HTTP request will be aborted if the provided context is
  8011. // canceled.
  8012. func (c *ManagedconfigurationsfordeviceDeleteCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceDeleteCall {
  8013. c.ctx_ = ctx
  8014. return c
  8015. }
  8016. // Header returns an http.Header that can be modified by the caller to
  8017. // add HTTP headers to the request.
  8018. func (c *ManagedconfigurationsfordeviceDeleteCall) Header() http.Header {
  8019. if c.header_ == nil {
  8020. c.header_ = make(http.Header)
  8021. }
  8022. return c.header_
  8023. }
  8024. func (c *ManagedconfigurationsfordeviceDeleteCall) doRequest(alt string) (*http.Response, error) {
  8025. reqHeaders := make(http.Header)
  8026. for k, v := range c.header_ {
  8027. reqHeaders[k] = v
  8028. }
  8029. reqHeaders.Set("User-Agent", c.s.userAgent())
  8030. var body io.Reader = nil
  8031. c.urlParams_.Set("alt", alt)
  8032. c.urlParams_.Set("prettyPrint", "false")
  8033. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  8034. urls += "?" + c.urlParams_.Encode()
  8035. req, err := http.NewRequest("DELETE", urls, body)
  8036. if err != nil {
  8037. return nil, err
  8038. }
  8039. req.Header = reqHeaders
  8040. googleapi.Expand(req.URL, map[string]string{
  8041. "enterpriseId": c.enterpriseId,
  8042. "userId": c.userId,
  8043. "deviceId": c.deviceId,
  8044. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  8045. })
  8046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8047. }
  8048. // Do executes the "androidenterprise.managedconfigurationsfordevice.delete" call.
  8049. func (c *ManagedconfigurationsfordeviceDeleteCall) Do(opts ...googleapi.CallOption) error {
  8050. gensupport.SetOptions(c.urlParams_, opts...)
  8051. res, err := c.doRequest("json")
  8052. if err != nil {
  8053. return err
  8054. }
  8055. defer googleapi.CloseBody(res)
  8056. if err := googleapi.CheckResponse(res); err != nil {
  8057. return err
  8058. }
  8059. return nil
  8060. // {
  8061. // "description": "Removes a per-device managed configuration for an app for the specified device.",
  8062. // "httpMethod": "DELETE",
  8063. // "id": "androidenterprise.managedconfigurationsfordevice.delete",
  8064. // "parameterOrder": [
  8065. // "enterpriseId",
  8066. // "userId",
  8067. // "deviceId",
  8068. // "managedConfigurationForDeviceId"
  8069. // ],
  8070. // "parameters": {
  8071. // "deviceId": {
  8072. // "description": "The Android ID of the device.",
  8073. // "location": "path",
  8074. // "required": true,
  8075. // "type": "string"
  8076. // },
  8077. // "enterpriseId": {
  8078. // "description": "The ID of the enterprise.",
  8079. // "location": "path",
  8080. // "required": true,
  8081. // "type": "string"
  8082. // },
  8083. // "managedConfigurationForDeviceId": {
  8084. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8085. // "location": "path",
  8086. // "required": true,
  8087. // "type": "string"
  8088. // },
  8089. // "userId": {
  8090. // "description": "The ID of the user.",
  8091. // "location": "path",
  8092. // "required": true,
  8093. // "type": "string"
  8094. // }
  8095. // },
  8096. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8097. // "scopes": [
  8098. // "https://www.googleapis.com/auth/androidenterprise"
  8099. // ]
  8100. // }
  8101. }
  8102. // method id "androidenterprise.managedconfigurationsfordevice.get":
  8103. type ManagedconfigurationsfordeviceGetCall struct {
  8104. s *Service
  8105. enterpriseId string
  8106. userId string
  8107. deviceId string
  8108. managedConfigurationForDeviceId string
  8109. urlParams_ gensupport.URLParams
  8110. ifNoneMatch_ string
  8111. ctx_ context.Context
  8112. header_ http.Header
  8113. }
  8114. // Get: Retrieves details of a per-device managed configuration.
  8115. func (r *ManagedconfigurationsfordeviceService) Get(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceGetCall {
  8116. c := &ManagedconfigurationsfordeviceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8117. c.enterpriseId = enterpriseId
  8118. c.userId = userId
  8119. c.deviceId = deviceId
  8120. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  8121. return c
  8122. }
  8123. // Fields allows partial responses to be retrieved. See
  8124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8125. // for more information.
  8126. func (c *ManagedconfigurationsfordeviceGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceGetCall {
  8127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8128. return c
  8129. }
  8130. // IfNoneMatch sets the optional parameter which makes the operation
  8131. // fail if the object's ETag matches the given value. This is useful for
  8132. // getting updates only after the object has changed since the last
  8133. // request. Use googleapi.IsNotModified to check whether the response
  8134. // error from Do is the result of In-None-Match.
  8135. func (c *ManagedconfigurationsfordeviceGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceGetCall {
  8136. c.ifNoneMatch_ = entityTag
  8137. return c
  8138. }
  8139. // Context sets the context to be used in this call's Do method. Any
  8140. // pending HTTP request will be aborted if the provided context is
  8141. // canceled.
  8142. func (c *ManagedconfigurationsfordeviceGetCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceGetCall {
  8143. c.ctx_ = ctx
  8144. return c
  8145. }
  8146. // Header returns an http.Header that can be modified by the caller to
  8147. // add HTTP headers to the request.
  8148. func (c *ManagedconfigurationsfordeviceGetCall) Header() http.Header {
  8149. if c.header_ == nil {
  8150. c.header_ = make(http.Header)
  8151. }
  8152. return c.header_
  8153. }
  8154. func (c *ManagedconfigurationsfordeviceGetCall) doRequest(alt string) (*http.Response, error) {
  8155. reqHeaders := make(http.Header)
  8156. for k, v := range c.header_ {
  8157. reqHeaders[k] = v
  8158. }
  8159. reqHeaders.Set("User-Agent", c.s.userAgent())
  8160. if c.ifNoneMatch_ != "" {
  8161. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8162. }
  8163. var body io.Reader = nil
  8164. c.urlParams_.Set("alt", alt)
  8165. c.urlParams_.Set("prettyPrint", "false")
  8166. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  8167. urls += "?" + c.urlParams_.Encode()
  8168. req, err := http.NewRequest("GET", urls, body)
  8169. if err != nil {
  8170. return nil, err
  8171. }
  8172. req.Header = reqHeaders
  8173. googleapi.Expand(req.URL, map[string]string{
  8174. "enterpriseId": c.enterpriseId,
  8175. "userId": c.userId,
  8176. "deviceId": c.deviceId,
  8177. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  8178. })
  8179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8180. }
  8181. // Do executes the "androidenterprise.managedconfigurationsfordevice.get" call.
  8182. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8183. // non-2xx status code is an error. Response headers are in either
  8184. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8185. // returned at all) in error.(*googleapi.Error).Header. Use
  8186. // googleapi.IsNotModified to check whether the returned error was
  8187. // because http.StatusNotModified was returned.
  8188. func (c *ManagedconfigurationsfordeviceGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8189. gensupport.SetOptions(c.urlParams_, opts...)
  8190. res, err := c.doRequest("json")
  8191. if res != nil && res.StatusCode == http.StatusNotModified {
  8192. if res.Body != nil {
  8193. res.Body.Close()
  8194. }
  8195. return nil, &googleapi.Error{
  8196. Code: res.StatusCode,
  8197. Header: res.Header,
  8198. }
  8199. }
  8200. if err != nil {
  8201. return nil, err
  8202. }
  8203. defer googleapi.CloseBody(res)
  8204. if err := googleapi.CheckResponse(res); err != nil {
  8205. return nil, err
  8206. }
  8207. ret := &ManagedConfiguration{
  8208. ServerResponse: googleapi.ServerResponse{
  8209. Header: res.Header,
  8210. HTTPStatusCode: res.StatusCode,
  8211. },
  8212. }
  8213. target := &ret
  8214. if err := gensupport.DecodeResponse(target, res); err != nil {
  8215. return nil, err
  8216. }
  8217. return ret, nil
  8218. // {
  8219. // "description": "Retrieves details of a per-device managed configuration.",
  8220. // "httpMethod": "GET",
  8221. // "id": "androidenterprise.managedconfigurationsfordevice.get",
  8222. // "parameterOrder": [
  8223. // "enterpriseId",
  8224. // "userId",
  8225. // "deviceId",
  8226. // "managedConfigurationForDeviceId"
  8227. // ],
  8228. // "parameters": {
  8229. // "deviceId": {
  8230. // "description": "The Android ID of the device.",
  8231. // "location": "path",
  8232. // "required": true,
  8233. // "type": "string"
  8234. // },
  8235. // "enterpriseId": {
  8236. // "description": "The ID of the enterprise.",
  8237. // "location": "path",
  8238. // "required": true,
  8239. // "type": "string"
  8240. // },
  8241. // "managedConfigurationForDeviceId": {
  8242. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8243. // "location": "path",
  8244. // "required": true,
  8245. // "type": "string"
  8246. // },
  8247. // "userId": {
  8248. // "description": "The ID of the user.",
  8249. // "location": "path",
  8250. // "required": true,
  8251. // "type": "string"
  8252. // }
  8253. // },
  8254. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8255. // "response": {
  8256. // "$ref": "ManagedConfiguration"
  8257. // },
  8258. // "scopes": [
  8259. // "https://www.googleapis.com/auth/androidenterprise"
  8260. // ]
  8261. // }
  8262. }
  8263. // method id "androidenterprise.managedconfigurationsfordevice.list":
  8264. type ManagedconfigurationsfordeviceListCall struct {
  8265. s *Service
  8266. enterpriseId string
  8267. userId string
  8268. deviceId string
  8269. urlParams_ gensupport.URLParams
  8270. ifNoneMatch_ string
  8271. ctx_ context.Context
  8272. header_ http.Header
  8273. }
  8274. // List: Lists all the per-device managed configurations for the
  8275. // specified device. Only the ID is set.
  8276. func (r *ManagedconfigurationsfordeviceService) List(enterpriseId string, userId string, deviceId string) *ManagedconfigurationsfordeviceListCall {
  8277. c := &ManagedconfigurationsfordeviceListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8278. c.enterpriseId = enterpriseId
  8279. c.userId = userId
  8280. c.deviceId = deviceId
  8281. return c
  8282. }
  8283. // Fields allows partial responses to be retrieved. See
  8284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8285. // for more information.
  8286. func (c *ManagedconfigurationsfordeviceListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceListCall {
  8287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8288. return c
  8289. }
  8290. // IfNoneMatch sets the optional parameter which makes the operation
  8291. // fail if the object's ETag matches the given value. This is useful for
  8292. // getting updates only after the object has changed since the last
  8293. // request. Use googleapi.IsNotModified to check whether the response
  8294. // error from Do is the result of In-None-Match.
  8295. func (c *ManagedconfigurationsfordeviceListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceListCall {
  8296. c.ifNoneMatch_ = entityTag
  8297. return c
  8298. }
  8299. // Context sets the context to be used in this call's Do method. Any
  8300. // pending HTTP request will be aborted if the provided context is
  8301. // canceled.
  8302. func (c *ManagedconfigurationsfordeviceListCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceListCall {
  8303. c.ctx_ = ctx
  8304. return c
  8305. }
  8306. // Header returns an http.Header that can be modified by the caller to
  8307. // add HTTP headers to the request.
  8308. func (c *ManagedconfigurationsfordeviceListCall) Header() http.Header {
  8309. if c.header_ == nil {
  8310. c.header_ = make(http.Header)
  8311. }
  8312. return c.header_
  8313. }
  8314. func (c *ManagedconfigurationsfordeviceListCall) doRequest(alt string) (*http.Response, error) {
  8315. reqHeaders := make(http.Header)
  8316. for k, v := range c.header_ {
  8317. reqHeaders[k] = v
  8318. }
  8319. reqHeaders.Set("User-Agent", c.s.userAgent())
  8320. if c.ifNoneMatch_ != "" {
  8321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8322. }
  8323. var body io.Reader = nil
  8324. c.urlParams_.Set("alt", alt)
  8325. c.urlParams_.Set("prettyPrint", "false")
  8326. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice")
  8327. urls += "?" + c.urlParams_.Encode()
  8328. req, err := http.NewRequest("GET", urls, body)
  8329. if err != nil {
  8330. return nil, err
  8331. }
  8332. req.Header = reqHeaders
  8333. googleapi.Expand(req.URL, map[string]string{
  8334. "enterpriseId": c.enterpriseId,
  8335. "userId": c.userId,
  8336. "deviceId": c.deviceId,
  8337. })
  8338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8339. }
  8340. // Do executes the "androidenterprise.managedconfigurationsfordevice.list" call.
  8341. // Exactly one of *ManagedConfigurationsForDeviceListResponse or error
  8342. // will be non-nil. Any non-2xx status code is an error. Response
  8343. // headers are in either
  8344. // *ManagedConfigurationsForDeviceListResponse.ServerResponse.Header or
  8345. // (if a response was returned at all) in
  8346. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8347. // whether the returned error was because http.StatusNotModified was
  8348. // returned.
  8349. func (c *ManagedconfigurationsfordeviceListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForDeviceListResponse, error) {
  8350. gensupport.SetOptions(c.urlParams_, opts...)
  8351. res, err := c.doRequest("json")
  8352. if res != nil && res.StatusCode == http.StatusNotModified {
  8353. if res.Body != nil {
  8354. res.Body.Close()
  8355. }
  8356. return nil, &googleapi.Error{
  8357. Code: res.StatusCode,
  8358. Header: res.Header,
  8359. }
  8360. }
  8361. if err != nil {
  8362. return nil, err
  8363. }
  8364. defer googleapi.CloseBody(res)
  8365. if err := googleapi.CheckResponse(res); err != nil {
  8366. return nil, err
  8367. }
  8368. ret := &ManagedConfigurationsForDeviceListResponse{
  8369. ServerResponse: googleapi.ServerResponse{
  8370. Header: res.Header,
  8371. HTTPStatusCode: res.StatusCode,
  8372. },
  8373. }
  8374. target := &ret
  8375. if err := gensupport.DecodeResponse(target, res); err != nil {
  8376. return nil, err
  8377. }
  8378. return ret, nil
  8379. // {
  8380. // "description": "Lists all the per-device managed configurations for the specified device. Only the ID is set.",
  8381. // "httpMethod": "GET",
  8382. // "id": "androidenterprise.managedconfigurationsfordevice.list",
  8383. // "parameterOrder": [
  8384. // "enterpriseId",
  8385. // "userId",
  8386. // "deviceId"
  8387. // ],
  8388. // "parameters": {
  8389. // "deviceId": {
  8390. // "description": "The Android ID of the device.",
  8391. // "location": "path",
  8392. // "required": true,
  8393. // "type": "string"
  8394. // },
  8395. // "enterpriseId": {
  8396. // "description": "The ID of the enterprise.",
  8397. // "location": "path",
  8398. // "required": true,
  8399. // "type": "string"
  8400. // },
  8401. // "userId": {
  8402. // "description": "The ID of the user.",
  8403. // "location": "path",
  8404. // "required": true,
  8405. // "type": "string"
  8406. // }
  8407. // },
  8408. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice",
  8409. // "response": {
  8410. // "$ref": "ManagedConfigurationsForDeviceListResponse"
  8411. // },
  8412. // "scopes": [
  8413. // "https://www.googleapis.com/auth/androidenterprise"
  8414. // ]
  8415. // }
  8416. }
  8417. // method id "androidenterprise.managedconfigurationsfordevice.patch":
  8418. type ManagedconfigurationsfordevicePatchCall struct {
  8419. s *Service
  8420. enterpriseId string
  8421. userId string
  8422. deviceId string
  8423. managedConfigurationForDeviceId string
  8424. managedconfiguration *ManagedConfiguration
  8425. urlParams_ gensupport.URLParams
  8426. ctx_ context.Context
  8427. header_ http.Header
  8428. }
  8429. // Patch: Adds or updates a per-device managed configuration for an app
  8430. // for the specified device. This method supports patch semantics.
  8431. func (r *ManagedconfigurationsfordeviceService) Patch(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordevicePatchCall {
  8432. c := &ManagedconfigurationsfordevicePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8433. c.enterpriseId = enterpriseId
  8434. c.userId = userId
  8435. c.deviceId = deviceId
  8436. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  8437. c.managedconfiguration = managedconfiguration
  8438. return c
  8439. }
  8440. // Fields allows partial responses to be retrieved. See
  8441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8442. // for more information.
  8443. func (c *ManagedconfigurationsfordevicePatchCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordevicePatchCall {
  8444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8445. return c
  8446. }
  8447. // Context sets the context to be used in this call's Do method. Any
  8448. // pending HTTP request will be aborted if the provided context is
  8449. // canceled.
  8450. func (c *ManagedconfigurationsfordevicePatchCall) Context(ctx context.Context) *ManagedconfigurationsfordevicePatchCall {
  8451. c.ctx_ = ctx
  8452. return c
  8453. }
  8454. // Header returns an http.Header that can be modified by the caller to
  8455. // add HTTP headers to the request.
  8456. func (c *ManagedconfigurationsfordevicePatchCall) Header() http.Header {
  8457. if c.header_ == nil {
  8458. c.header_ = make(http.Header)
  8459. }
  8460. return c.header_
  8461. }
  8462. func (c *ManagedconfigurationsfordevicePatchCall) doRequest(alt string) (*http.Response, error) {
  8463. reqHeaders := make(http.Header)
  8464. for k, v := range c.header_ {
  8465. reqHeaders[k] = v
  8466. }
  8467. reqHeaders.Set("User-Agent", c.s.userAgent())
  8468. var body io.Reader = nil
  8469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  8470. if err != nil {
  8471. return nil, err
  8472. }
  8473. reqHeaders.Set("Content-Type", "application/json")
  8474. c.urlParams_.Set("alt", alt)
  8475. c.urlParams_.Set("prettyPrint", "false")
  8476. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  8477. urls += "?" + c.urlParams_.Encode()
  8478. req, err := http.NewRequest("PATCH", urls, body)
  8479. if err != nil {
  8480. return nil, err
  8481. }
  8482. req.Header = reqHeaders
  8483. googleapi.Expand(req.URL, map[string]string{
  8484. "enterpriseId": c.enterpriseId,
  8485. "userId": c.userId,
  8486. "deviceId": c.deviceId,
  8487. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  8488. })
  8489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8490. }
  8491. // Do executes the "androidenterprise.managedconfigurationsfordevice.patch" call.
  8492. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8493. // non-2xx status code is an error. Response headers are in either
  8494. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8495. // returned at all) in error.(*googleapi.Error).Header. Use
  8496. // googleapi.IsNotModified to check whether the returned error was
  8497. // because http.StatusNotModified was returned.
  8498. func (c *ManagedconfigurationsfordevicePatchCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8499. gensupport.SetOptions(c.urlParams_, opts...)
  8500. res, err := c.doRequest("json")
  8501. if res != nil && res.StatusCode == http.StatusNotModified {
  8502. if res.Body != nil {
  8503. res.Body.Close()
  8504. }
  8505. return nil, &googleapi.Error{
  8506. Code: res.StatusCode,
  8507. Header: res.Header,
  8508. }
  8509. }
  8510. if err != nil {
  8511. return nil, err
  8512. }
  8513. defer googleapi.CloseBody(res)
  8514. if err := googleapi.CheckResponse(res); err != nil {
  8515. return nil, err
  8516. }
  8517. ret := &ManagedConfiguration{
  8518. ServerResponse: googleapi.ServerResponse{
  8519. Header: res.Header,
  8520. HTTPStatusCode: res.StatusCode,
  8521. },
  8522. }
  8523. target := &ret
  8524. if err := gensupport.DecodeResponse(target, res); err != nil {
  8525. return nil, err
  8526. }
  8527. return ret, nil
  8528. // {
  8529. // "description": "Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics.",
  8530. // "httpMethod": "PATCH",
  8531. // "id": "androidenterprise.managedconfigurationsfordevice.patch",
  8532. // "parameterOrder": [
  8533. // "enterpriseId",
  8534. // "userId",
  8535. // "deviceId",
  8536. // "managedConfigurationForDeviceId"
  8537. // ],
  8538. // "parameters": {
  8539. // "deviceId": {
  8540. // "description": "The Android ID of the device.",
  8541. // "location": "path",
  8542. // "required": true,
  8543. // "type": "string"
  8544. // },
  8545. // "enterpriseId": {
  8546. // "description": "The ID of the enterprise.",
  8547. // "location": "path",
  8548. // "required": true,
  8549. // "type": "string"
  8550. // },
  8551. // "managedConfigurationForDeviceId": {
  8552. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8553. // "location": "path",
  8554. // "required": true,
  8555. // "type": "string"
  8556. // },
  8557. // "userId": {
  8558. // "description": "The ID of the user.",
  8559. // "location": "path",
  8560. // "required": true,
  8561. // "type": "string"
  8562. // }
  8563. // },
  8564. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8565. // "request": {
  8566. // "$ref": "ManagedConfiguration"
  8567. // },
  8568. // "response": {
  8569. // "$ref": "ManagedConfiguration"
  8570. // },
  8571. // "scopes": [
  8572. // "https://www.googleapis.com/auth/androidenterprise"
  8573. // ]
  8574. // }
  8575. }
  8576. // method id "androidenterprise.managedconfigurationsfordevice.update":
  8577. type ManagedconfigurationsfordeviceUpdateCall struct {
  8578. s *Service
  8579. enterpriseId string
  8580. userId string
  8581. deviceId string
  8582. managedConfigurationForDeviceId string
  8583. managedconfiguration *ManagedConfiguration
  8584. urlParams_ gensupport.URLParams
  8585. ctx_ context.Context
  8586. header_ http.Header
  8587. }
  8588. // Update: Adds or updates a per-device managed configuration for an app
  8589. // for the specified device.
  8590. func (r *ManagedconfigurationsfordeviceService) Update(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordeviceUpdateCall {
  8591. c := &ManagedconfigurationsfordeviceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8592. c.enterpriseId = enterpriseId
  8593. c.userId = userId
  8594. c.deviceId = deviceId
  8595. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  8596. c.managedconfiguration = managedconfiguration
  8597. return c
  8598. }
  8599. // Fields allows partial responses to be retrieved. See
  8600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8601. // for more information.
  8602. func (c *ManagedconfigurationsfordeviceUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceUpdateCall {
  8603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8604. return c
  8605. }
  8606. // Context sets the context to be used in this call's Do method. Any
  8607. // pending HTTP request will be aborted if the provided context is
  8608. // canceled.
  8609. func (c *ManagedconfigurationsfordeviceUpdateCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceUpdateCall {
  8610. c.ctx_ = ctx
  8611. return c
  8612. }
  8613. // Header returns an http.Header that can be modified by the caller to
  8614. // add HTTP headers to the request.
  8615. func (c *ManagedconfigurationsfordeviceUpdateCall) Header() http.Header {
  8616. if c.header_ == nil {
  8617. c.header_ = make(http.Header)
  8618. }
  8619. return c.header_
  8620. }
  8621. func (c *ManagedconfigurationsfordeviceUpdateCall) doRequest(alt string) (*http.Response, error) {
  8622. reqHeaders := make(http.Header)
  8623. for k, v := range c.header_ {
  8624. reqHeaders[k] = v
  8625. }
  8626. reqHeaders.Set("User-Agent", c.s.userAgent())
  8627. var body io.Reader = nil
  8628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  8629. if err != nil {
  8630. return nil, err
  8631. }
  8632. reqHeaders.Set("Content-Type", "application/json")
  8633. c.urlParams_.Set("alt", alt)
  8634. c.urlParams_.Set("prettyPrint", "false")
  8635. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  8636. urls += "?" + c.urlParams_.Encode()
  8637. req, err := http.NewRequest("PUT", urls, body)
  8638. if err != nil {
  8639. return nil, err
  8640. }
  8641. req.Header = reqHeaders
  8642. googleapi.Expand(req.URL, map[string]string{
  8643. "enterpriseId": c.enterpriseId,
  8644. "userId": c.userId,
  8645. "deviceId": c.deviceId,
  8646. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  8647. })
  8648. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8649. }
  8650. // Do executes the "androidenterprise.managedconfigurationsfordevice.update" call.
  8651. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8652. // non-2xx status code is an error. Response headers are in either
  8653. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8654. // returned at all) in error.(*googleapi.Error).Header. Use
  8655. // googleapi.IsNotModified to check whether the returned error was
  8656. // because http.StatusNotModified was returned.
  8657. func (c *ManagedconfigurationsfordeviceUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8658. gensupport.SetOptions(c.urlParams_, opts...)
  8659. res, err := c.doRequest("json")
  8660. if res != nil && res.StatusCode == http.StatusNotModified {
  8661. if res.Body != nil {
  8662. res.Body.Close()
  8663. }
  8664. return nil, &googleapi.Error{
  8665. Code: res.StatusCode,
  8666. Header: res.Header,
  8667. }
  8668. }
  8669. if err != nil {
  8670. return nil, err
  8671. }
  8672. defer googleapi.CloseBody(res)
  8673. if err := googleapi.CheckResponse(res); err != nil {
  8674. return nil, err
  8675. }
  8676. ret := &ManagedConfiguration{
  8677. ServerResponse: googleapi.ServerResponse{
  8678. Header: res.Header,
  8679. HTTPStatusCode: res.StatusCode,
  8680. },
  8681. }
  8682. target := &ret
  8683. if err := gensupport.DecodeResponse(target, res); err != nil {
  8684. return nil, err
  8685. }
  8686. return ret, nil
  8687. // {
  8688. // "description": "Adds or updates a per-device managed configuration for an app for the specified device.",
  8689. // "httpMethod": "PUT",
  8690. // "id": "androidenterprise.managedconfigurationsfordevice.update",
  8691. // "parameterOrder": [
  8692. // "enterpriseId",
  8693. // "userId",
  8694. // "deviceId",
  8695. // "managedConfigurationForDeviceId"
  8696. // ],
  8697. // "parameters": {
  8698. // "deviceId": {
  8699. // "description": "The Android ID of the device.",
  8700. // "location": "path",
  8701. // "required": true,
  8702. // "type": "string"
  8703. // },
  8704. // "enterpriseId": {
  8705. // "description": "The ID of the enterprise.",
  8706. // "location": "path",
  8707. // "required": true,
  8708. // "type": "string"
  8709. // },
  8710. // "managedConfigurationForDeviceId": {
  8711. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8712. // "location": "path",
  8713. // "required": true,
  8714. // "type": "string"
  8715. // },
  8716. // "userId": {
  8717. // "description": "The ID of the user.",
  8718. // "location": "path",
  8719. // "required": true,
  8720. // "type": "string"
  8721. // }
  8722. // },
  8723. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8724. // "request": {
  8725. // "$ref": "ManagedConfiguration"
  8726. // },
  8727. // "response": {
  8728. // "$ref": "ManagedConfiguration"
  8729. // },
  8730. // "scopes": [
  8731. // "https://www.googleapis.com/auth/androidenterprise"
  8732. // ]
  8733. // }
  8734. }
  8735. // method id "androidenterprise.managedconfigurationsforuser.delete":
  8736. type ManagedconfigurationsforuserDeleteCall struct {
  8737. s *Service
  8738. enterpriseId string
  8739. userId string
  8740. managedConfigurationForUserId string
  8741. urlParams_ gensupport.URLParams
  8742. ctx_ context.Context
  8743. header_ http.Header
  8744. }
  8745. // Delete: Removes a per-user managed configuration for an app for the
  8746. // specified user.
  8747. func (r *ManagedconfigurationsforuserService) Delete(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserDeleteCall {
  8748. c := &ManagedconfigurationsforuserDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8749. c.enterpriseId = enterpriseId
  8750. c.userId = userId
  8751. c.managedConfigurationForUserId = managedConfigurationForUserId
  8752. return c
  8753. }
  8754. // Fields allows partial responses to be retrieved. See
  8755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8756. // for more information.
  8757. func (c *ManagedconfigurationsforuserDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserDeleteCall {
  8758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8759. return c
  8760. }
  8761. // Context sets the context to be used in this call's Do method. Any
  8762. // pending HTTP request will be aborted if the provided context is
  8763. // canceled.
  8764. func (c *ManagedconfigurationsforuserDeleteCall) Context(ctx context.Context) *ManagedconfigurationsforuserDeleteCall {
  8765. c.ctx_ = ctx
  8766. return c
  8767. }
  8768. // Header returns an http.Header that can be modified by the caller to
  8769. // add HTTP headers to the request.
  8770. func (c *ManagedconfigurationsforuserDeleteCall) Header() http.Header {
  8771. if c.header_ == nil {
  8772. c.header_ = make(http.Header)
  8773. }
  8774. return c.header_
  8775. }
  8776. func (c *ManagedconfigurationsforuserDeleteCall) doRequest(alt string) (*http.Response, error) {
  8777. reqHeaders := make(http.Header)
  8778. for k, v := range c.header_ {
  8779. reqHeaders[k] = v
  8780. }
  8781. reqHeaders.Set("User-Agent", c.s.userAgent())
  8782. var body io.Reader = nil
  8783. c.urlParams_.Set("alt", alt)
  8784. c.urlParams_.Set("prettyPrint", "false")
  8785. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  8786. urls += "?" + c.urlParams_.Encode()
  8787. req, err := http.NewRequest("DELETE", urls, body)
  8788. if err != nil {
  8789. return nil, err
  8790. }
  8791. req.Header = reqHeaders
  8792. googleapi.Expand(req.URL, map[string]string{
  8793. "enterpriseId": c.enterpriseId,
  8794. "userId": c.userId,
  8795. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  8796. })
  8797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8798. }
  8799. // Do executes the "androidenterprise.managedconfigurationsforuser.delete" call.
  8800. func (c *ManagedconfigurationsforuserDeleteCall) Do(opts ...googleapi.CallOption) error {
  8801. gensupport.SetOptions(c.urlParams_, opts...)
  8802. res, err := c.doRequest("json")
  8803. if err != nil {
  8804. return err
  8805. }
  8806. defer googleapi.CloseBody(res)
  8807. if err := googleapi.CheckResponse(res); err != nil {
  8808. return err
  8809. }
  8810. return nil
  8811. // {
  8812. // "description": "Removes a per-user managed configuration for an app for the specified user.",
  8813. // "httpMethod": "DELETE",
  8814. // "id": "androidenterprise.managedconfigurationsforuser.delete",
  8815. // "parameterOrder": [
  8816. // "enterpriseId",
  8817. // "userId",
  8818. // "managedConfigurationForUserId"
  8819. // ],
  8820. // "parameters": {
  8821. // "enterpriseId": {
  8822. // "description": "The ID of the enterprise.",
  8823. // "location": "path",
  8824. // "required": true,
  8825. // "type": "string"
  8826. // },
  8827. // "managedConfigurationForUserId": {
  8828. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8829. // "location": "path",
  8830. // "required": true,
  8831. // "type": "string"
  8832. // },
  8833. // "userId": {
  8834. // "description": "The ID of the user.",
  8835. // "location": "path",
  8836. // "required": true,
  8837. // "type": "string"
  8838. // }
  8839. // },
  8840. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  8841. // "scopes": [
  8842. // "https://www.googleapis.com/auth/androidenterprise"
  8843. // ]
  8844. // }
  8845. }
  8846. // method id "androidenterprise.managedconfigurationsforuser.get":
  8847. type ManagedconfigurationsforuserGetCall struct {
  8848. s *Service
  8849. enterpriseId string
  8850. userId string
  8851. managedConfigurationForUserId string
  8852. urlParams_ gensupport.URLParams
  8853. ifNoneMatch_ string
  8854. ctx_ context.Context
  8855. header_ http.Header
  8856. }
  8857. // Get: Retrieves details of a per-user managed configuration for an app
  8858. // for the specified user.
  8859. func (r *ManagedconfigurationsforuserService) Get(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserGetCall {
  8860. c := &ManagedconfigurationsforuserGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8861. c.enterpriseId = enterpriseId
  8862. c.userId = userId
  8863. c.managedConfigurationForUserId = managedConfigurationForUserId
  8864. return c
  8865. }
  8866. // Fields allows partial responses to be retrieved. See
  8867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8868. // for more information.
  8869. func (c *ManagedconfigurationsforuserGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserGetCall {
  8870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8871. return c
  8872. }
  8873. // IfNoneMatch sets the optional parameter which makes the operation
  8874. // fail if the object's ETag matches the given value. This is useful for
  8875. // getting updates only after the object has changed since the last
  8876. // request. Use googleapi.IsNotModified to check whether the response
  8877. // error from Do is the result of In-None-Match.
  8878. func (c *ManagedconfigurationsforuserGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserGetCall {
  8879. c.ifNoneMatch_ = entityTag
  8880. return c
  8881. }
  8882. // Context sets the context to be used in this call's Do method. Any
  8883. // pending HTTP request will be aborted if the provided context is
  8884. // canceled.
  8885. func (c *ManagedconfigurationsforuserGetCall) Context(ctx context.Context) *ManagedconfigurationsforuserGetCall {
  8886. c.ctx_ = ctx
  8887. return c
  8888. }
  8889. // Header returns an http.Header that can be modified by the caller to
  8890. // add HTTP headers to the request.
  8891. func (c *ManagedconfigurationsforuserGetCall) Header() http.Header {
  8892. if c.header_ == nil {
  8893. c.header_ = make(http.Header)
  8894. }
  8895. return c.header_
  8896. }
  8897. func (c *ManagedconfigurationsforuserGetCall) doRequest(alt string) (*http.Response, error) {
  8898. reqHeaders := make(http.Header)
  8899. for k, v := range c.header_ {
  8900. reqHeaders[k] = v
  8901. }
  8902. reqHeaders.Set("User-Agent", c.s.userAgent())
  8903. if c.ifNoneMatch_ != "" {
  8904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8905. }
  8906. var body io.Reader = nil
  8907. c.urlParams_.Set("alt", alt)
  8908. c.urlParams_.Set("prettyPrint", "false")
  8909. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  8910. urls += "?" + c.urlParams_.Encode()
  8911. req, err := http.NewRequest("GET", urls, body)
  8912. if err != nil {
  8913. return nil, err
  8914. }
  8915. req.Header = reqHeaders
  8916. googleapi.Expand(req.URL, map[string]string{
  8917. "enterpriseId": c.enterpriseId,
  8918. "userId": c.userId,
  8919. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  8920. })
  8921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8922. }
  8923. // Do executes the "androidenterprise.managedconfigurationsforuser.get" call.
  8924. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8925. // non-2xx status code is an error. Response headers are in either
  8926. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8927. // returned at all) in error.(*googleapi.Error).Header. Use
  8928. // googleapi.IsNotModified to check whether the returned error was
  8929. // because http.StatusNotModified was returned.
  8930. func (c *ManagedconfigurationsforuserGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8931. gensupport.SetOptions(c.urlParams_, opts...)
  8932. res, err := c.doRequest("json")
  8933. if res != nil && res.StatusCode == http.StatusNotModified {
  8934. if res.Body != nil {
  8935. res.Body.Close()
  8936. }
  8937. return nil, &googleapi.Error{
  8938. Code: res.StatusCode,
  8939. Header: res.Header,
  8940. }
  8941. }
  8942. if err != nil {
  8943. return nil, err
  8944. }
  8945. defer googleapi.CloseBody(res)
  8946. if err := googleapi.CheckResponse(res); err != nil {
  8947. return nil, err
  8948. }
  8949. ret := &ManagedConfiguration{
  8950. ServerResponse: googleapi.ServerResponse{
  8951. Header: res.Header,
  8952. HTTPStatusCode: res.StatusCode,
  8953. },
  8954. }
  8955. target := &ret
  8956. if err := gensupport.DecodeResponse(target, res); err != nil {
  8957. return nil, err
  8958. }
  8959. return ret, nil
  8960. // {
  8961. // "description": "Retrieves details of a per-user managed configuration for an app for the specified user.",
  8962. // "httpMethod": "GET",
  8963. // "id": "androidenterprise.managedconfigurationsforuser.get",
  8964. // "parameterOrder": [
  8965. // "enterpriseId",
  8966. // "userId",
  8967. // "managedConfigurationForUserId"
  8968. // ],
  8969. // "parameters": {
  8970. // "enterpriseId": {
  8971. // "description": "The ID of the enterprise.",
  8972. // "location": "path",
  8973. // "required": true,
  8974. // "type": "string"
  8975. // },
  8976. // "managedConfigurationForUserId": {
  8977. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8978. // "location": "path",
  8979. // "required": true,
  8980. // "type": "string"
  8981. // },
  8982. // "userId": {
  8983. // "description": "The ID of the user.",
  8984. // "location": "path",
  8985. // "required": true,
  8986. // "type": "string"
  8987. // }
  8988. // },
  8989. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  8990. // "response": {
  8991. // "$ref": "ManagedConfiguration"
  8992. // },
  8993. // "scopes": [
  8994. // "https://www.googleapis.com/auth/androidenterprise"
  8995. // ]
  8996. // }
  8997. }
  8998. // method id "androidenterprise.managedconfigurationsforuser.list":
  8999. type ManagedconfigurationsforuserListCall struct {
  9000. s *Service
  9001. enterpriseId string
  9002. userId string
  9003. urlParams_ gensupport.URLParams
  9004. ifNoneMatch_ string
  9005. ctx_ context.Context
  9006. header_ http.Header
  9007. }
  9008. // List: Lists all the per-user managed configurations for the specified
  9009. // user. Only the ID is set.
  9010. func (r *ManagedconfigurationsforuserService) List(enterpriseId string, userId string) *ManagedconfigurationsforuserListCall {
  9011. c := &ManagedconfigurationsforuserListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9012. c.enterpriseId = enterpriseId
  9013. c.userId = userId
  9014. return c
  9015. }
  9016. // Fields allows partial responses to be retrieved. See
  9017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9018. // for more information.
  9019. func (c *ManagedconfigurationsforuserListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserListCall {
  9020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9021. return c
  9022. }
  9023. // IfNoneMatch sets the optional parameter which makes the operation
  9024. // fail if the object's ETag matches the given value. This is useful for
  9025. // getting updates only after the object has changed since the last
  9026. // request. Use googleapi.IsNotModified to check whether the response
  9027. // error from Do is the result of In-None-Match.
  9028. func (c *ManagedconfigurationsforuserListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserListCall {
  9029. c.ifNoneMatch_ = entityTag
  9030. return c
  9031. }
  9032. // Context sets the context to be used in this call's Do method. Any
  9033. // pending HTTP request will be aborted if the provided context is
  9034. // canceled.
  9035. func (c *ManagedconfigurationsforuserListCall) Context(ctx context.Context) *ManagedconfigurationsforuserListCall {
  9036. c.ctx_ = ctx
  9037. return c
  9038. }
  9039. // Header returns an http.Header that can be modified by the caller to
  9040. // add HTTP headers to the request.
  9041. func (c *ManagedconfigurationsforuserListCall) Header() http.Header {
  9042. if c.header_ == nil {
  9043. c.header_ = make(http.Header)
  9044. }
  9045. return c.header_
  9046. }
  9047. func (c *ManagedconfigurationsforuserListCall) doRequest(alt string) (*http.Response, error) {
  9048. reqHeaders := make(http.Header)
  9049. for k, v := range c.header_ {
  9050. reqHeaders[k] = v
  9051. }
  9052. reqHeaders.Set("User-Agent", c.s.userAgent())
  9053. if c.ifNoneMatch_ != "" {
  9054. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9055. }
  9056. var body io.Reader = nil
  9057. c.urlParams_.Set("alt", alt)
  9058. c.urlParams_.Set("prettyPrint", "false")
  9059. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser")
  9060. urls += "?" + c.urlParams_.Encode()
  9061. req, err := http.NewRequest("GET", urls, body)
  9062. if err != nil {
  9063. return nil, err
  9064. }
  9065. req.Header = reqHeaders
  9066. googleapi.Expand(req.URL, map[string]string{
  9067. "enterpriseId": c.enterpriseId,
  9068. "userId": c.userId,
  9069. })
  9070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9071. }
  9072. // Do executes the "androidenterprise.managedconfigurationsforuser.list" call.
  9073. // Exactly one of *ManagedConfigurationsForUserListResponse or error
  9074. // will be non-nil. Any non-2xx status code is an error. Response
  9075. // headers are in either
  9076. // *ManagedConfigurationsForUserListResponse.ServerResponse.Header or
  9077. // (if a response was returned at all) in
  9078. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9079. // whether the returned error was because http.StatusNotModified was
  9080. // returned.
  9081. func (c *ManagedconfigurationsforuserListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForUserListResponse, error) {
  9082. gensupport.SetOptions(c.urlParams_, opts...)
  9083. res, err := c.doRequest("json")
  9084. if res != nil && res.StatusCode == http.StatusNotModified {
  9085. if res.Body != nil {
  9086. res.Body.Close()
  9087. }
  9088. return nil, &googleapi.Error{
  9089. Code: res.StatusCode,
  9090. Header: res.Header,
  9091. }
  9092. }
  9093. if err != nil {
  9094. return nil, err
  9095. }
  9096. defer googleapi.CloseBody(res)
  9097. if err := googleapi.CheckResponse(res); err != nil {
  9098. return nil, err
  9099. }
  9100. ret := &ManagedConfigurationsForUserListResponse{
  9101. ServerResponse: googleapi.ServerResponse{
  9102. Header: res.Header,
  9103. HTTPStatusCode: res.StatusCode,
  9104. },
  9105. }
  9106. target := &ret
  9107. if err := gensupport.DecodeResponse(target, res); err != nil {
  9108. return nil, err
  9109. }
  9110. return ret, nil
  9111. // {
  9112. // "description": "Lists all the per-user managed configurations for the specified user. Only the ID is set.",
  9113. // "httpMethod": "GET",
  9114. // "id": "androidenterprise.managedconfigurationsforuser.list",
  9115. // "parameterOrder": [
  9116. // "enterpriseId",
  9117. // "userId"
  9118. // ],
  9119. // "parameters": {
  9120. // "enterpriseId": {
  9121. // "description": "The ID of the enterprise.",
  9122. // "location": "path",
  9123. // "required": true,
  9124. // "type": "string"
  9125. // },
  9126. // "userId": {
  9127. // "description": "The ID of the user.",
  9128. // "location": "path",
  9129. // "required": true,
  9130. // "type": "string"
  9131. // }
  9132. // },
  9133. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser",
  9134. // "response": {
  9135. // "$ref": "ManagedConfigurationsForUserListResponse"
  9136. // },
  9137. // "scopes": [
  9138. // "https://www.googleapis.com/auth/androidenterprise"
  9139. // ]
  9140. // }
  9141. }
  9142. // method id "androidenterprise.managedconfigurationsforuser.patch":
  9143. type ManagedconfigurationsforuserPatchCall struct {
  9144. s *Service
  9145. enterpriseId string
  9146. userId string
  9147. managedConfigurationForUserId string
  9148. managedconfiguration *ManagedConfiguration
  9149. urlParams_ gensupport.URLParams
  9150. ctx_ context.Context
  9151. header_ http.Header
  9152. }
  9153. // Patch: Adds or updates the managed configuration settings for an app
  9154. // for the specified user. If you support the Managed configurations
  9155. // iframe, you can apply managed configurations to a user by specifying
  9156. // an mcmId and its associated configuration variables (if any) in the
  9157. // request. Alternatively, all EMMs can apply managed configurations by
  9158. // passing a list of managed properties. This method supports patch
  9159. // semantics.
  9160. func (r *ManagedconfigurationsforuserService) Patch(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserPatchCall {
  9161. c := &ManagedconfigurationsforuserPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9162. c.enterpriseId = enterpriseId
  9163. c.userId = userId
  9164. c.managedConfigurationForUserId = managedConfigurationForUserId
  9165. c.managedconfiguration = managedconfiguration
  9166. return c
  9167. }
  9168. // Fields allows partial responses to be retrieved. See
  9169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9170. // for more information.
  9171. func (c *ManagedconfigurationsforuserPatchCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserPatchCall {
  9172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9173. return c
  9174. }
  9175. // Context sets the context to be used in this call's Do method. Any
  9176. // pending HTTP request will be aborted if the provided context is
  9177. // canceled.
  9178. func (c *ManagedconfigurationsforuserPatchCall) Context(ctx context.Context) *ManagedconfigurationsforuserPatchCall {
  9179. c.ctx_ = ctx
  9180. return c
  9181. }
  9182. // Header returns an http.Header that can be modified by the caller to
  9183. // add HTTP headers to the request.
  9184. func (c *ManagedconfigurationsforuserPatchCall) Header() http.Header {
  9185. if c.header_ == nil {
  9186. c.header_ = make(http.Header)
  9187. }
  9188. return c.header_
  9189. }
  9190. func (c *ManagedconfigurationsforuserPatchCall) doRequest(alt string) (*http.Response, error) {
  9191. reqHeaders := make(http.Header)
  9192. for k, v := range c.header_ {
  9193. reqHeaders[k] = v
  9194. }
  9195. reqHeaders.Set("User-Agent", c.s.userAgent())
  9196. var body io.Reader = nil
  9197. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  9198. if err != nil {
  9199. return nil, err
  9200. }
  9201. reqHeaders.Set("Content-Type", "application/json")
  9202. c.urlParams_.Set("alt", alt)
  9203. c.urlParams_.Set("prettyPrint", "false")
  9204. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  9205. urls += "?" + c.urlParams_.Encode()
  9206. req, err := http.NewRequest("PATCH", urls, body)
  9207. if err != nil {
  9208. return nil, err
  9209. }
  9210. req.Header = reqHeaders
  9211. googleapi.Expand(req.URL, map[string]string{
  9212. "enterpriseId": c.enterpriseId,
  9213. "userId": c.userId,
  9214. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  9215. })
  9216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9217. }
  9218. // Do executes the "androidenterprise.managedconfigurationsforuser.patch" call.
  9219. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  9220. // non-2xx status code is an error. Response headers are in either
  9221. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  9222. // returned at all) in error.(*googleapi.Error).Header. Use
  9223. // googleapi.IsNotModified to check whether the returned error was
  9224. // because http.StatusNotModified was returned.
  9225. func (c *ManagedconfigurationsforuserPatchCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  9226. gensupport.SetOptions(c.urlParams_, opts...)
  9227. res, err := c.doRequest("json")
  9228. if res != nil && res.StatusCode == http.StatusNotModified {
  9229. if res.Body != nil {
  9230. res.Body.Close()
  9231. }
  9232. return nil, &googleapi.Error{
  9233. Code: res.StatusCode,
  9234. Header: res.Header,
  9235. }
  9236. }
  9237. if err != nil {
  9238. return nil, err
  9239. }
  9240. defer googleapi.CloseBody(res)
  9241. if err := googleapi.CheckResponse(res); err != nil {
  9242. return nil, err
  9243. }
  9244. ret := &ManagedConfiguration{
  9245. ServerResponse: googleapi.ServerResponse{
  9246. Header: res.Header,
  9247. HTTPStatusCode: res.StatusCode,
  9248. },
  9249. }
  9250. target := &ret
  9251. if err := gensupport.DecodeResponse(target, res); err != nil {
  9252. return nil, err
  9253. }
  9254. return ret, nil
  9255. // {
  9256. // "description": "Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties. This method supports patch semantics.",
  9257. // "httpMethod": "PATCH",
  9258. // "id": "androidenterprise.managedconfigurationsforuser.patch",
  9259. // "parameterOrder": [
  9260. // "enterpriseId",
  9261. // "userId",
  9262. // "managedConfigurationForUserId"
  9263. // ],
  9264. // "parameters": {
  9265. // "enterpriseId": {
  9266. // "description": "The ID of the enterprise.",
  9267. // "location": "path",
  9268. // "required": true,
  9269. // "type": "string"
  9270. // },
  9271. // "managedConfigurationForUserId": {
  9272. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  9273. // "location": "path",
  9274. // "required": true,
  9275. // "type": "string"
  9276. // },
  9277. // "userId": {
  9278. // "description": "The ID of the user.",
  9279. // "location": "path",
  9280. // "required": true,
  9281. // "type": "string"
  9282. // }
  9283. // },
  9284. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  9285. // "request": {
  9286. // "$ref": "ManagedConfiguration"
  9287. // },
  9288. // "response": {
  9289. // "$ref": "ManagedConfiguration"
  9290. // },
  9291. // "scopes": [
  9292. // "https://www.googleapis.com/auth/androidenterprise"
  9293. // ]
  9294. // }
  9295. }
  9296. // method id "androidenterprise.managedconfigurationsforuser.update":
  9297. type ManagedconfigurationsforuserUpdateCall struct {
  9298. s *Service
  9299. enterpriseId string
  9300. userId string
  9301. managedConfigurationForUserId string
  9302. managedconfiguration *ManagedConfiguration
  9303. urlParams_ gensupport.URLParams
  9304. ctx_ context.Context
  9305. header_ http.Header
  9306. }
  9307. // Update: Adds or updates the managed configuration settings for an app
  9308. // for the specified user. If you support the Managed configurations
  9309. // iframe, you can apply managed configurations to a user by specifying
  9310. // an mcmId and its associated configuration variables (if any) in the
  9311. // request. Alternatively, all EMMs can apply managed configurations by
  9312. // passing a list of managed properties.
  9313. func (r *ManagedconfigurationsforuserService) Update(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserUpdateCall {
  9314. c := &ManagedconfigurationsforuserUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9315. c.enterpriseId = enterpriseId
  9316. c.userId = userId
  9317. c.managedConfigurationForUserId = managedConfigurationForUserId
  9318. c.managedconfiguration = managedconfiguration
  9319. return c
  9320. }
  9321. // Fields allows partial responses to be retrieved. See
  9322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9323. // for more information.
  9324. func (c *ManagedconfigurationsforuserUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserUpdateCall {
  9325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9326. return c
  9327. }
  9328. // Context sets the context to be used in this call's Do method. Any
  9329. // pending HTTP request will be aborted if the provided context is
  9330. // canceled.
  9331. func (c *ManagedconfigurationsforuserUpdateCall) Context(ctx context.Context) *ManagedconfigurationsforuserUpdateCall {
  9332. c.ctx_ = ctx
  9333. return c
  9334. }
  9335. // Header returns an http.Header that can be modified by the caller to
  9336. // add HTTP headers to the request.
  9337. func (c *ManagedconfigurationsforuserUpdateCall) Header() http.Header {
  9338. if c.header_ == nil {
  9339. c.header_ = make(http.Header)
  9340. }
  9341. return c.header_
  9342. }
  9343. func (c *ManagedconfigurationsforuserUpdateCall) doRequest(alt string) (*http.Response, error) {
  9344. reqHeaders := make(http.Header)
  9345. for k, v := range c.header_ {
  9346. reqHeaders[k] = v
  9347. }
  9348. reqHeaders.Set("User-Agent", c.s.userAgent())
  9349. var body io.Reader = nil
  9350. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  9351. if err != nil {
  9352. return nil, err
  9353. }
  9354. reqHeaders.Set("Content-Type", "application/json")
  9355. c.urlParams_.Set("alt", alt)
  9356. c.urlParams_.Set("prettyPrint", "false")
  9357. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  9358. urls += "?" + c.urlParams_.Encode()
  9359. req, err := http.NewRequest("PUT", urls, body)
  9360. if err != nil {
  9361. return nil, err
  9362. }
  9363. req.Header = reqHeaders
  9364. googleapi.Expand(req.URL, map[string]string{
  9365. "enterpriseId": c.enterpriseId,
  9366. "userId": c.userId,
  9367. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  9368. })
  9369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9370. }
  9371. // Do executes the "androidenterprise.managedconfigurationsforuser.update" call.
  9372. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  9373. // non-2xx status code is an error. Response headers are in either
  9374. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  9375. // returned at all) in error.(*googleapi.Error).Header. Use
  9376. // googleapi.IsNotModified to check whether the returned error was
  9377. // because http.StatusNotModified was returned.
  9378. func (c *ManagedconfigurationsforuserUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  9379. gensupport.SetOptions(c.urlParams_, opts...)
  9380. res, err := c.doRequest("json")
  9381. if res != nil && res.StatusCode == http.StatusNotModified {
  9382. if res.Body != nil {
  9383. res.Body.Close()
  9384. }
  9385. return nil, &googleapi.Error{
  9386. Code: res.StatusCode,
  9387. Header: res.Header,
  9388. }
  9389. }
  9390. if err != nil {
  9391. return nil, err
  9392. }
  9393. defer googleapi.CloseBody(res)
  9394. if err := googleapi.CheckResponse(res); err != nil {
  9395. return nil, err
  9396. }
  9397. ret := &ManagedConfiguration{
  9398. ServerResponse: googleapi.ServerResponse{
  9399. Header: res.Header,
  9400. HTTPStatusCode: res.StatusCode,
  9401. },
  9402. }
  9403. target := &ret
  9404. if err := gensupport.DecodeResponse(target, res); err != nil {
  9405. return nil, err
  9406. }
  9407. return ret, nil
  9408. // {
  9409. // "description": "Adds or updates the managed configuration settings for an app for the specified user. If you support the Managed configurations iframe, you can apply managed configurations to a user by specifying an mcmId and its associated configuration variables (if any) in the request. Alternatively, all EMMs can apply managed configurations by passing a list of managed properties.",
  9410. // "httpMethod": "PUT",
  9411. // "id": "androidenterprise.managedconfigurationsforuser.update",
  9412. // "parameterOrder": [
  9413. // "enterpriseId",
  9414. // "userId",
  9415. // "managedConfigurationForUserId"
  9416. // ],
  9417. // "parameters": {
  9418. // "enterpriseId": {
  9419. // "description": "The ID of the enterprise.",
  9420. // "location": "path",
  9421. // "required": true,
  9422. // "type": "string"
  9423. // },
  9424. // "managedConfigurationForUserId": {
  9425. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  9426. // "location": "path",
  9427. // "required": true,
  9428. // "type": "string"
  9429. // },
  9430. // "userId": {
  9431. // "description": "The ID of the user.",
  9432. // "location": "path",
  9433. // "required": true,
  9434. // "type": "string"
  9435. // }
  9436. // },
  9437. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  9438. // "request": {
  9439. // "$ref": "ManagedConfiguration"
  9440. // },
  9441. // "response": {
  9442. // "$ref": "ManagedConfiguration"
  9443. // },
  9444. // "scopes": [
  9445. // "https://www.googleapis.com/auth/androidenterprise"
  9446. // ]
  9447. // }
  9448. }
  9449. // method id "androidenterprise.managedconfigurationssettings.list":
  9450. type ManagedconfigurationssettingsListCall struct {
  9451. s *Service
  9452. enterpriseId string
  9453. productId string
  9454. urlParams_ gensupport.URLParams
  9455. ifNoneMatch_ string
  9456. ctx_ context.Context
  9457. header_ http.Header
  9458. }
  9459. // List: Lists all the managed configurations settings for the specified
  9460. // app. Only the ID and the name is set.
  9461. func (r *ManagedconfigurationssettingsService) List(enterpriseId string, productId string) *ManagedconfigurationssettingsListCall {
  9462. c := &ManagedconfigurationssettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9463. c.enterpriseId = enterpriseId
  9464. c.productId = productId
  9465. return c
  9466. }
  9467. // Fields allows partial responses to be retrieved. See
  9468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9469. // for more information.
  9470. func (c *ManagedconfigurationssettingsListCall) Fields(s ...googleapi.Field) *ManagedconfigurationssettingsListCall {
  9471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9472. return c
  9473. }
  9474. // IfNoneMatch sets the optional parameter which makes the operation
  9475. // fail if the object's ETag matches the given value. This is useful for
  9476. // getting updates only after the object has changed since the last
  9477. // request. Use googleapi.IsNotModified to check whether the response
  9478. // error from Do is the result of In-None-Match.
  9479. func (c *ManagedconfigurationssettingsListCall) IfNoneMatch(entityTag string) *ManagedconfigurationssettingsListCall {
  9480. c.ifNoneMatch_ = entityTag
  9481. return c
  9482. }
  9483. // Context sets the context to be used in this call's Do method. Any
  9484. // pending HTTP request will be aborted if the provided context is
  9485. // canceled.
  9486. func (c *ManagedconfigurationssettingsListCall) Context(ctx context.Context) *ManagedconfigurationssettingsListCall {
  9487. c.ctx_ = ctx
  9488. return c
  9489. }
  9490. // Header returns an http.Header that can be modified by the caller to
  9491. // add HTTP headers to the request.
  9492. func (c *ManagedconfigurationssettingsListCall) Header() http.Header {
  9493. if c.header_ == nil {
  9494. c.header_ = make(http.Header)
  9495. }
  9496. return c.header_
  9497. }
  9498. func (c *ManagedconfigurationssettingsListCall) doRequest(alt string) (*http.Response, error) {
  9499. reqHeaders := make(http.Header)
  9500. for k, v := range c.header_ {
  9501. reqHeaders[k] = v
  9502. }
  9503. reqHeaders.Set("User-Agent", c.s.userAgent())
  9504. if c.ifNoneMatch_ != "" {
  9505. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9506. }
  9507. var body io.Reader = nil
  9508. c.urlParams_.Set("alt", alt)
  9509. c.urlParams_.Set("prettyPrint", "false")
  9510. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings")
  9511. urls += "?" + c.urlParams_.Encode()
  9512. req, err := http.NewRequest("GET", urls, body)
  9513. if err != nil {
  9514. return nil, err
  9515. }
  9516. req.Header = reqHeaders
  9517. googleapi.Expand(req.URL, map[string]string{
  9518. "enterpriseId": c.enterpriseId,
  9519. "productId": c.productId,
  9520. })
  9521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9522. }
  9523. // Do executes the "androidenterprise.managedconfigurationssettings.list" call.
  9524. // Exactly one of *ManagedConfigurationsSettingsListResponse or error
  9525. // will be non-nil. Any non-2xx status code is an error. Response
  9526. // headers are in either
  9527. // *ManagedConfigurationsSettingsListResponse.ServerResponse.Header or
  9528. // (if a response was returned at all) in
  9529. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9530. // whether the returned error was because http.StatusNotModified was
  9531. // returned.
  9532. func (c *ManagedconfigurationssettingsListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsSettingsListResponse, error) {
  9533. gensupport.SetOptions(c.urlParams_, opts...)
  9534. res, err := c.doRequest("json")
  9535. if res != nil && res.StatusCode == http.StatusNotModified {
  9536. if res.Body != nil {
  9537. res.Body.Close()
  9538. }
  9539. return nil, &googleapi.Error{
  9540. Code: res.StatusCode,
  9541. Header: res.Header,
  9542. }
  9543. }
  9544. if err != nil {
  9545. return nil, err
  9546. }
  9547. defer googleapi.CloseBody(res)
  9548. if err := googleapi.CheckResponse(res); err != nil {
  9549. return nil, err
  9550. }
  9551. ret := &ManagedConfigurationsSettingsListResponse{
  9552. ServerResponse: googleapi.ServerResponse{
  9553. Header: res.Header,
  9554. HTTPStatusCode: res.StatusCode,
  9555. },
  9556. }
  9557. target := &ret
  9558. if err := gensupport.DecodeResponse(target, res); err != nil {
  9559. return nil, err
  9560. }
  9561. return ret, nil
  9562. // {
  9563. // "description": "Lists all the managed configurations settings for the specified app. Only the ID and the name is set.",
  9564. // "httpMethod": "GET",
  9565. // "id": "androidenterprise.managedconfigurationssettings.list",
  9566. // "parameterOrder": [
  9567. // "enterpriseId",
  9568. // "productId"
  9569. // ],
  9570. // "parameters": {
  9571. // "enterpriseId": {
  9572. // "description": "The ID of the enterprise.",
  9573. // "location": "path",
  9574. // "required": true,
  9575. // "type": "string"
  9576. // },
  9577. // "productId": {
  9578. // "description": "The ID of the product for which the managed configurations settings applies to.",
  9579. // "location": "path",
  9580. // "required": true,
  9581. // "type": "string"
  9582. // }
  9583. // },
  9584. // "path": "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings",
  9585. // "response": {
  9586. // "$ref": "ManagedConfigurationsSettingsListResponse"
  9587. // },
  9588. // "scopes": [
  9589. // "https://www.googleapis.com/auth/androidenterprise"
  9590. // ]
  9591. // }
  9592. }
  9593. // method id "androidenterprise.permissions.get":
  9594. type PermissionsGetCall struct {
  9595. s *Service
  9596. permissionId string
  9597. urlParams_ gensupport.URLParams
  9598. ifNoneMatch_ string
  9599. ctx_ context.Context
  9600. header_ http.Header
  9601. }
  9602. // Get: Retrieves details of an Android app permission for display to an
  9603. // enterprise admin.
  9604. func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall {
  9605. c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9606. c.permissionId = permissionId
  9607. return c
  9608. }
  9609. // Language sets the optional parameter "language": The BCP47 tag for
  9610. // the user's preferred language (e.g. "en-US", "de")
  9611. func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall {
  9612. c.urlParams_.Set("language", language)
  9613. return c
  9614. }
  9615. // Fields allows partial responses to be retrieved. See
  9616. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9617. // for more information.
  9618. func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
  9619. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9620. return c
  9621. }
  9622. // IfNoneMatch sets the optional parameter which makes the operation
  9623. // fail if the object's ETag matches the given value. This is useful for
  9624. // getting updates only after the object has changed since the last
  9625. // request. Use googleapi.IsNotModified to check whether the response
  9626. // error from Do is the result of In-None-Match.
  9627. func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
  9628. c.ifNoneMatch_ = entityTag
  9629. return c
  9630. }
  9631. // Context sets the context to be used in this call's Do method. Any
  9632. // pending HTTP request will be aborted if the provided context is
  9633. // canceled.
  9634. func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
  9635. c.ctx_ = ctx
  9636. return c
  9637. }
  9638. // Header returns an http.Header that can be modified by the caller to
  9639. // add HTTP headers to the request.
  9640. func (c *PermissionsGetCall) Header() http.Header {
  9641. if c.header_ == nil {
  9642. c.header_ = make(http.Header)
  9643. }
  9644. return c.header_
  9645. }
  9646. func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  9647. reqHeaders := make(http.Header)
  9648. for k, v := range c.header_ {
  9649. reqHeaders[k] = v
  9650. }
  9651. reqHeaders.Set("User-Agent", c.s.userAgent())
  9652. if c.ifNoneMatch_ != "" {
  9653. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9654. }
  9655. var body io.Reader = nil
  9656. c.urlParams_.Set("alt", alt)
  9657. c.urlParams_.Set("prettyPrint", "false")
  9658. urls := googleapi.ResolveRelative(c.s.BasePath, "permissions/{permissionId}")
  9659. urls += "?" + c.urlParams_.Encode()
  9660. req, err := http.NewRequest("GET", urls, body)
  9661. if err != nil {
  9662. return nil, err
  9663. }
  9664. req.Header = reqHeaders
  9665. googleapi.Expand(req.URL, map[string]string{
  9666. "permissionId": c.permissionId,
  9667. })
  9668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9669. }
  9670. // Do executes the "androidenterprise.permissions.get" call.
  9671. // Exactly one of *Permission or error will be non-nil. Any non-2xx
  9672. // status code is an error. Response headers are in either
  9673. // *Permission.ServerResponse.Header or (if a response was returned at
  9674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9675. // to check whether the returned error was because
  9676. // http.StatusNotModified was returned.
  9677. func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
  9678. gensupport.SetOptions(c.urlParams_, opts...)
  9679. res, err := c.doRequest("json")
  9680. if res != nil && res.StatusCode == http.StatusNotModified {
  9681. if res.Body != nil {
  9682. res.Body.Close()
  9683. }
  9684. return nil, &googleapi.Error{
  9685. Code: res.StatusCode,
  9686. Header: res.Header,
  9687. }
  9688. }
  9689. if err != nil {
  9690. return nil, err
  9691. }
  9692. defer googleapi.CloseBody(res)
  9693. if err := googleapi.CheckResponse(res); err != nil {
  9694. return nil, err
  9695. }
  9696. ret := &Permission{
  9697. ServerResponse: googleapi.ServerResponse{
  9698. Header: res.Header,
  9699. HTTPStatusCode: res.StatusCode,
  9700. },
  9701. }
  9702. target := &ret
  9703. if err := gensupport.DecodeResponse(target, res); err != nil {
  9704. return nil, err
  9705. }
  9706. return ret, nil
  9707. // {
  9708. // "description": "Retrieves details of an Android app permission for display to an enterprise admin.",
  9709. // "httpMethod": "GET",
  9710. // "id": "androidenterprise.permissions.get",
  9711. // "parameterOrder": [
  9712. // "permissionId"
  9713. // ],
  9714. // "parameters": {
  9715. // "language": {
  9716. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")",
  9717. // "location": "query",
  9718. // "type": "string"
  9719. // },
  9720. // "permissionId": {
  9721. // "description": "The ID of the permission.",
  9722. // "location": "path",
  9723. // "required": true,
  9724. // "type": "string"
  9725. // }
  9726. // },
  9727. // "path": "permissions/{permissionId}",
  9728. // "response": {
  9729. // "$ref": "Permission"
  9730. // },
  9731. // "scopes": [
  9732. // "https://www.googleapis.com/auth/androidenterprise"
  9733. // ]
  9734. // }
  9735. }
  9736. // method id "androidenterprise.products.approve":
  9737. type ProductsApproveCall struct {
  9738. s *Service
  9739. enterpriseId string
  9740. productId string
  9741. productsapproverequest *ProductsApproveRequest
  9742. urlParams_ gensupport.URLParams
  9743. ctx_ context.Context
  9744. header_ http.Header
  9745. }
  9746. // Approve: Approves the specified product and the relevant app
  9747. // permissions, if any. The maximum number of products that you can
  9748. // approve per enterprise customer is 1,000.
  9749. //
  9750. // To learn how to use managed Google Play to design and create a store
  9751. // layout to display approved products to your users, see Store Layout
  9752. // Design.
  9753. func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall {
  9754. c := &ProductsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9755. c.enterpriseId = enterpriseId
  9756. c.productId = productId
  9757. c.productsapproverequest = productsapproverequest
  9758. return c
  9759. }
  9760. // Fields allows partial responses to be retrieved. See
  9761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9762. // for more information.
  9763. func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall {
  9764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9765. return c
  9766. }
  9767. // Context sets the context to be used in this call's Do method. Any
  9768. // pending HTTP request will be aborted if the provided context is
  9769. // canceled.
  9770. func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall {
  9771. c.ctx_ = ctx
  9772. return c
  9773. }
  9774. // Header returns an http.Header that can be modified by the caller to
  9775. // add HTTP headers to the request.
  9776. func (c *ProductsApproveCall) Header() http.Header {
  9777. if c.header_ == nil {
  9778. c.header_ = make(http.Header)
  9779. }
  9780. return c.header_
  9781. }
  9782. func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) {
  9783. reqHeaders := make(http.Header)
  9784. for k, v := range c.header_ {
  9785. reqHeaders[k] = v
  9786. }
  9787. reqHeaders.Set("User-Agent", c.s.userAgent())
  9788. var body io.Reader = nil
  9789. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest)
  9790. if err != nil {
  9791. return nil, err
  9792. }
  9793. reqHeaders.Set("Content-Type", "application/json")
  9794. c.urlParams_.Set("alt", alt)
  9795. c.urlParams_.Set("prettyPrint", "false")
  9796. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/approve")
  9797. urls += "?" + c.urlParams_.Encode()
  9798. req, err := http.NewRequest("POST", urls, body)
  9799. if err != nil {
  9800. return nil, err
  9801. }
  9802. req.Header = reqHeaders
  9803. googleapi.Expand(req.URL, map[string]string{
  9804. "enterpriseId": c.enterpriseId,
  9805. "productId": c.productId,
  9806. })
  9807. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9808. }
  9809. // Do executes the "androidenterprise.products.approve" call.
  9810. func (c *ProductsApproveCall) Do(opts ...googleapi.CallOption) error {
  9811. gensupport.SetOptions(c.urlParams_, opts...)
  9812. res, err := c.doRequest("json")
  9813. if err != nil {
  9814. return err
  9815. }
  9816. defer googleapi.CloseBody(res)
  9817. if err := googleapi.CheckResponse(res); err != nil {
  9818. return err
  9819. }
  9820. return nil
  9821. // {
  9822. // "description": "Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000.\n\nTo learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design.",
  9823. // "httpMethod": "POST",
  9824. // "id": "androidenterprise.products.approve",
  9825. // "parameterOrder": [
  9826. // "enterpriseId",
  9827. // "productId"
  9828. // ],
  9829. // "parameters": {
  9830. // "enterpriseId": {
  9831. // "description": "The ID of the enterprise.",
  9832. // "location": "path",
  9833. // "required": true,
  9834. // "type": "string"
  9835. // },
  9836. // "productId": {
  9837. // "description": "The ID of the product.",
  9838. // "location": "path",
  9839. // "required": true,
  9840. // "type": "string"
  9841. // }
  9842. // },
  9843. // "path": "enterprises/{enterpriseId}/products/{productId}/approve",
  9844. // "request": {
  9845. // "$ref": "ProductsApproveRequest"
  9846. // },
  9847. // "scopes": [
  9848. // "https://www.googleapis.com/auth/androidenterprise"
  9849. // ]
  9850. // }
  9851. }
  9852. // method id "androidenterprise.products.generateApprovalUrl":
  9853. type ProductsGenerateApprovalUrlCall struct {
  9854. s *Service
  9855. enterpriseId string
  9856. productId string
  9857. urlParams_ gensupport.URLParams
  9858. ctx_ context.Context
  9859. header_ http.Header
  9860. }
  9861. // GenerateApprovalUrl: Generates a URL that can be rendered in an
  9862. // iframe to display the permissions (if any) of a product. An
  9863. // enterprise admin must view these permissions and accept them on
  9864. // behalf of their organization in order to approve that
  9865. // product.
  9866. //
  9867. // Admins should accept the displayed permissions by interacting with a
  9868. // separate UI element in the EMM console, which in turn should trigger
  9869. // the use of this URL as the approvalUrlInfo.approvalUrl property in a
  9870. // Products.approve call to approve the product. This URL can only be
  9871. // used to display permissions for up to 1 day.
  9872. func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall {
  9873. c := &ProductsGenerateApprovalUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9874. c.enterpriseId = enterpriseId
  9875. c.productId = productId
  9876. return c
  9877. }
  9878. // LanguageCode sets the optional parameter "languageCode": The BCP 47
  9879. // language code used for permission names and descriptions in the
  9880. // returned iframe, for instance "en-US".
  9881. func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall {
  9882. c.urlParams_.Set("languageCode", languageCode)
  9883. return c
  9884. }
  9885. // Fields allows partial responses to be retrieved. See
  9886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9887. // for more information.
  9888. func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall {
  9889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9890. return c
  9891. }
  9892. // Context sets the context to be used in this call's Do method. Any
  9893. // pending HTTP request will be aborted if the provided context is
  9894. // canceled.
  9895. func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall {
  9896. c.ctx_ = ctx
  9897. return c
  9898. }
  9899. // Header returns an http.Header that can be modified by the caller to
  9900. // add HTTP headers to the request.
  9901. func (c *ProductsGenerateApprovalUrlCall) Header() http.Header {
  9902. if c.header_ == nil {
  9903. c.header_ = make(http.Header)
  9904. }
  9905. return c.header_
  9906. }
  9907. func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) {
  9908. reqHeaders := make(http.Header)
  9909. for k, v := range c.header_ {
  9910. reqHeaders[k] = v
  9911. }
  9912. reqHeaders.Set("User-Agent", c.s.userAgent())
  9913. var body io.Reader = nil
  9914. c.urlParams_.Set("alt", alt)
  9915. c.urlParams_.Set("prettyPrint", "false")
  9916. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl")
  9917. urls += "?" + c.urlParams_.Encode()
  9918. req, err := http.NewRequest("POST", urls, body)
  9919. if err != nil {
  9920. return nil, err
  9921. }
  9922. req.Header = reqHeaders
  9923. googleapi.Expand(req.URL, map[string]string{
  9924. "enterpriseId": c.enterpriseId,
  9925. "productId": c.productId,
  9926. })
  9927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9928. }
  9929. // Do executes the "androidenterprise.products.generateApprovalUrl" call.
  9930. // Exactly one of *ProductsGenerateApprovalUrlResponse or error will be
  9931. // non-nil. Any non-2xx status code is an error. Response headers are in
  9932. // either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or
  9933. // (if a response was returned at all) in
  9934. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9935. // whether the returned error was because http.StatusNotModified was
  9936. // returned.
  9937. func (c *ProductsGenerateApprovalUrlCall) Do(opts ...googleapi.CallOption) (*ProductsGenerateApprovalUrlResponse, error) {
  9938. gensupport.SetOptions(c.urlParams_, opts...)
  9939. res, err := c.doRequest("json")
  9940. if res != nil && res.StatusCode == http.StatusNotModified {
  9941. if res.Body != nil {
  9942. res.Body.Close()
  9943. }
  9944. return nil, &googleapi.Error{
  9945. Code: res.StatusCode,
  9946. Header: res.Header,
  9947. }
  9948. }
  9949. if err != nil {
  9950. return nil, err
  9951. }
  9952. defer googleapi.CloseBody(res)
  9953. if err := googleapi.CheckResponse(res); err != nil {
  9954. return nil, err
  9955. }
  9956. ret := &ProductsGenerateApprovalUrlResponse{
  9957. ServerResponse: googleapi.ServerResponse{
  9958. Header: res.Header,
  9959. HTTPStatusCode: res.StatusCode,
  9960. },
  9961. }
  9962. target := &ret
  9963. if err := gensupport.DecodeResponse(target, res); err != nil {
  9964. return nil, err
  9965. }
  9966. return ret, nil
  9967. // {
  9968. // "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.",
  9969. // "httpMethod": "POST",
  9970. // "id": "androidenterprise.products.generateApprovalUrl",
  9971. // "parameterOrder": [
  9972. // "enterpriseId",
  9973. // "productId"
  9974. // ],
  9975. // "parameters": {
  9976. // "enterpriseId": {
  9977. // "description": "The ID of the enterprise.",
  9978. // "location": "path",
  9979. // "required": true,
  9980. // "type": "string"
  9981. // },
  9982. // "languageCode": {
  9983. // "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".",
  9984. // "location": "query",
  9985. // "type": "string"
  9986. // },
  9987. // "productId": {
  9988. // "description": "The ID of the product.",
  9989. // "location": "path",
  9990. // "required": true,
  9991. // "type": "string"
  9992. // }
  9993. // },
  9994. // "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl",
  9995. // "response": {
  9996. // "$ref": "ProductsGenerateApprovalUrlResponse"
  9997. // },
  9998. // "scopes": [
  9999. // "https://www.googleapis.com/auth/androidenterprise"
  10000. // ]
  10001. // }
  10002. }
  10003. // method id "androidenterprise.products.get":
  10004. type ProductsGetCall struct {
  10005. s *Service
  10006. enterpriseId string
  10007. productId string
  10008. urlParams_ gensupport.URLParams
  10009. ifNoneMatch_ string
  10010. ctx_ context.Context
  10011. header_ http.Header
  10012. }
  10013. // Get: Retrieves details of a product for display to an enterprise
  10014. // admin.
  10015. func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall {
  10016. c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10017. c.enterpriseId = enterpriseId
  10018. c.productId = productId
  10019. return c
  10020. }
  10021. // Language sets the optional parameter "language": The BCP47 tag for
  10022. // the user's preferred language (e.g. "en-US", "de").
  10023. func (c *ProductsGetCall) Language(language string) *ProductsGetCall {
  10024. c.urlParams_.Set("language", language)
  10025. return c
  10026. }
  10027. // Fields allows partial responses to be retrieved. See
  10028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10029. // for more information.
  10030. func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
  10031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10032. return c
  10033. }
  10034. // IfNoneMatch sets the optional parameter which makes the operation
  10035. // fail if the object's ETag matches the given value. This is useful for
  10036. // getting updates only after the object has changed since the last
  10037. // request. Use googleapi.IsNotModified to check whether the response
  10038. // error from Do is the result of In-None-Match.
  10039. func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
  10040. c.ifNoneMatch_ = entityTag
  10041. return c
  10042. }
  10043. // Context sets the context to be used in this call's Do method. Any
  10044. // pending HTTP request will be aborted if the provided context is
  10045. // canceled.
  10046. func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
  10047. c.ctx_ = ctx
  10048. return c
  10049. }
  10050. // Header returns an http.Header that can be modified by the caller to
  10051. // add HTTP headers to the request.
  10052. func (c *ProductsGetCall) Header() http.Header {
  10053. if c.header_ == nil {
  10054. c.header_ = make(http.Header)
  10055. }
  10056. return c.header_
  10057. }
  10058. func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
  10059. reqHeaders := make(http.Header)
  10060. for k, v := range c.header_ {
  10061. reqHeaders[k] = v
  10062. }
  10063. reqHeaders.Set("User-Agent", c.s.userAgent())
  10064. if c.ifNoneMatch_ != "" {
  10065. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10066. }
  10067. var body io.Reader = nil
  10068. c.urlParams_.Set("alt", alt)
  10069. c.urlParams_.Set("prettyPrint", "false")
  10070. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}")
  10071. urls += "?" + c.urlParams_.Encode()
  10072. req, err := http.NewRequest("GET", urls, body)
  10073. if err != nil {
  10074. return nil, err
  10075. }
  10076. req.Header = reqHeaders
  10077. googleapi.Expand(req.URL, map[string]string{
  10078. "enterpriseId": c.enterpriseId,
  10079. "productId": c.productId,
  10080. })
  10081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10082. }
  10083. // Do executes the "androidenterprise.products.get" call.
  10084. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  10085. // code is an error. Response headers are in either
  10086. // *Product.ServerResponse.Header or (if a response was returned at all)
  10087. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10088. // check whether the returned error was because http.StatusNotModified
  10089. // was returned.
  10090. func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  10091. gensupport.SetOptions(c.urlParams_, opts...)
  10092. res, err := c.doRequest("json")
  10093. if res != nil && res.StatusCode == http.StatusNotModified {
  10094. if res.Body != nil {
  10095. res.Body.Close()
  10096. }
  10097. return nil, &googleapi.Error{
  10098. Code: res.StatusCode,
  10099. Header: res.Header,
  10100. }
  10101. }
  10102. if err != nil {
  10103. return nil, err
  10104. }
  10105. defer googleapi.CloseBody(res)
  10106. if err := googleapi.CheckResponse(res); err != nil {
  10107. return nil, err
  10108. }
  10109. ret := &Product{
  10110. ServerResponse: googleapi.ServerResponse{
  10111. Header: res.Header,
  10112. HTTPStatusCode: res.StatusCode,
  10113. },
  10114. }
  10115. target := &ret
  10116. if err := gensupport.DecodeResponse(target, res); err != nil {
  10117. return nil, err
  10118. }
  10119. return ret, nil
  10120. // {
  10121. // "description": "Retrieves details of a product for display to an enterprise admin.",
  10122. // "httpMethod": "GET",
  10123. // "id": "androidenterprise.products.get",
  10124. // "parameterOrder": [
  10125. // "enterpriseId",
  10126. // "productId"
  10127. // ],
  10128. // "parameters": {
  10129. // "enterpriseId": {
  10130. // "description": "The ID of the enterprise.",
  10131. // "location": "path",
  10132. // "required": true,
  10133. // "type": "string"
  10134. // },
  10135. // "language": {
  10136. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
  10137. // "location": "query",
  10138. // "type": "string"
  10139. // },
  10140. // "productId": {
  10141. // "description": "The ID of the product, e.g. \"app:com.google.android.gm\".",
  10142. // "location": "path",
  10143. // "required": true,
  10144. // "type": "string"
  10145. // }
  10146. // },
  10147. // "path": "enterprises/{enterpriseId}/products/{productId}",
  10148. // "response": {
  10149. // "$ref": "Product"
  10150. // },
  10151. // "scopes": [
  10152. // "https://www.googleapis.com/auth/androidenterprise"
  10153. // ]
  10154. // }
  10155. }
  10156. // method id "androidenterprise.products.getAppRestrictionsSchema":
  10157. type ProductsGetAppRestrictionsSchemaCall struct {
  10158. s *Service
  10159. enterpriseId string
  10160. productId string
  10161. urlParams_ gensupport.URLParams
  10162. ifNoneMatch_ string
  10163. ctx_ context.Context
  10164. header_ http.Header
  10165. }
  10166. // GetAppRestrictionsSchema: Retrieves the schema that defines the
  10167. // configurable properties for this product. All products have a schema,
  10168. // but this schema may be empty if no managed configurations have been
  10169. // defined. This schema can be used to populate a UI that allows an
  10170. // admin to configure the product. To apply a managed configuration
  10171. // based on the schema obtained using this API, see Managed
  10172. // Configurations through Play.
  10173. func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall {
  10174. c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10175. c.enterpriseId = enterpriseId
  10176. c.productId = productId
  10177. return c
  10178. }
  10179. // Language sets the optional parameter "language": The BCP47 tag for
  10180. // the user's preferred language (e.g. "en-US", "de").
  10181. func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall {
  10182. c.urlParams_.Set("language", language)
  10183. return c
  10184. }
  10185. // Fields allows partial responses to be retrieved. See
  10186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10187. // for more information.
  10188. func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall {
  10189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10190. return c
  10191. }
  10192. // IfNoneMatch sets the optional parameter which makes the operation
  10193. // fail if the object's ETag matches the given value. This is useful for
  10194. // getting updates only after the object has changed since the last
  10195. // request. Use googleapi.IsNotModified to check whether the response
  10196. // error from Do is the result of In-None-Match.
  10197. func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall {
  10198. c.ifNoneMatch_ = entityTag
  10199. return c
  10200. }
  10201. // Context sets the context to be used in this call's Do method. Any
  10202. // pending HTTP request will be aborted if the provided context is
  10203. // canceled.
  10204. func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall {
  10205. c.ctx_ = ctx
  10206. return c
  10207. }
  10208. // Header returns an http.Header that can be modified by the caller to
  10209. // add HTTP headers to the request.
  10210. func (c *ProductsGetAppRestrictionsSchemaCall) Header() http.Header {
  10211. if c.header_ == nil {
  10212. c.header_ = make(http.Header)
  10213. }
  10214. return c.header_
  10215. }
  10216. func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) {
  10217. reqHeaders := make(http.Header)
  10218. for k, v := range c.header_ {
  10219. reqHeaders[k] = v
  10220. }
  10221. reqHeaders.Set("User-Agent", c.s.userAgent())
  10222. if c.ifNoneMatch_ != "" {
  10223. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10224. }
  10225. var body io.Reader = nil
  10226. c.urlParams_.Set("alt", alt)
  10227. c.urlParams_.Set("prettyPrint", "false")
  10228. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema")
  10229. urls += "?" + c.urlParams_.Encode()
  10230. req, err := http.NewRequest("GET", urls, body)
  10231. if err != nil {
  10232. return nil, err
  10233. }
  10234. req.Header = reqHeaders
  10235. googleapi.Expand(req.URL, map[string]string{
  10236. "enterpriseId": c.enterpriseId,
  10237. "productId": c.productId,
  10238. })
  10239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10240. }
  10241. // Do executes the "androidenterprise.products.getAppRestrictionsSchema" call.
  10242. // Exactly one of *AppRestrictionsSchema or error will be non-nil. Any
  10243. // non-2xx status code is an error. Response headers are in either
  10244. // *AppRestrictionsSchema.ServerResponse.Header or (if a response was
  10245. // returned at all) in error.(*googleapi.Error).Header. Use
  10246. // googleapi.IsNotModified to check whether the returned error was
  10247. // because http.StatusNotModified was returned.
  10248. func (c *ProductsGetAppRestrictionsSchemaCall) Do(opts ...googleapi.CallOption) (*AppRestrictionsSchema, error) {
  10249. gensupport.SetOptions(c.urlParams_, opts...)
  10250. res, err := c.doRequest("json")
  10251. if res != nil && res.StatusCode == http.StatusNotModified {
  10252. if res.Body != nil {
  10253. res.Body.Close()
  10254. }
  10255. return nil, &googleapi.Error{
  10256. Code: res.StatusCode,
  10257. Header: res.Header,
  10258. }
  10259. }
  10260. if err != nil {
  10261. return nil, err
  10262. }
  10263. defer googleapi.CloseBody(res)
  10264. if err := googleapi.CheckResponse(res); err != nil {
  10265. return nil, err
  10266. }
  10267. ret := &AppRestrictionsSchema{
  10268. ServerResponse: googleapi.ServerResponse{
  10269. Header: res.Header,
  10270. HTTPStatusCode: res.StatusCode,
  10271. },
  10272. }
  10273. target := &ret
  10274. if err := gensupport.DecodeResponse(target, res); err != nil {
  10275. return nil, err
  10276. }
  10277. return ret, nil
  10278. // {
  10279. // "description": "Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play.",
  10280. // "httpMethod": "GET",
  10281. // "id": "androidenterprise.products.getAppRestrictionsSchema",
  10282. // "parameterOrder": [
  10283. // "enterpriseId",
  10284. // "productId"
  10285. // ],
  10286. // "parameters": {
  10287. // "enterpriseId": {
  10288. // "description": "The ID of the enterprise.",
  10289. // "location": "path",
  10290. // "required": true,
  10291. // "type": "string"
  10292. // },
  10293. // "language": {
  10294. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
  10295. // "location": "query",
  10296. // "type": "string"
  10297. // },
  10298. // "productId": {
  10299. // "description": "The ID of the product.",
  10300. // "location": "path",
  10301. // "required": true,
  10302. // "type": "string"
  10303. // }
  10304. // },
  10305. // "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema",
  10306. // "response": {
  10307. // "$ref": "AppRestrictionsSchema"
  10308. // },
  10309. // "scopes": [
  10310. // "https://www.googleapis.com/auth/androidenterprise"
  10311. // ]
  10312. // }
  10313. }
  10314. // method id "androidenterprise.products.getPermissions":
  10315. type ProductsGetPermissionsCall struct {
  10316. s *Service
  10317. enterpriseId string
  10318. productId string
  10319. urlParams_ gensupport.URLParams
  10320. ifNoneMatch_ string
  10321. ctx_ context.Context
  10322. header_ http.Header
  10323. }
  10324. // GetPermissions: Retrieves the Android app permissions required by
  10325. // this app.
  10326. func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall {
  10327. c := &ProductsGetPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10328. c.enterpriseId = enterpriseId
  10329. c.productId = productId
  10330. return c
  10331. }
  10332. // Fields allows partial responses to be retrieved. See
  10333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10334. // for more information.
  10335. func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall {
  10336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10337. return c
  10338. }
  10339. // IfNoneMatch sets the optional parameter which makes the operation
  10340. // fail if the object's ETag matches the given value. This is useful for
  10341. // getting updates only after the object has changed since the last
  10342. // request. Use googleapi.IsNotModified to check whether the response
  10343. // error from Do is the result of In-None-Match.
  10344. func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall {
  10345. c.ifNoneMatch_ = entityTag
  10346. return c
  10347. }
  10348. // Context sets the context to be used in this call's Do method. Any
  10349. // pending HTTP request will be aborted if the provided context is
  10350. // canceled.
  10351. func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall {
  10352. c.ctx_ = ctx
  10353. return c
  10354. }
  10355. // Header returns an http.Header that can be modified by the caller to
  10356. // add HTTP headers to the request.
  10357. func (c *ProductsGetPermissionsCall) Header() http.Header {
  10358. if c.header_ == nil {
  10359. c.header_ = make(http.Header)
  10360. }
  10361. return c.header_
  10362. }
  10363. func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) {
  10364. reqHeaders := make(http.Header)
  10365. for k, v := range c.header_ {
  10366. reqHeaders[k] = v
  10367. }
  10368. reqHeaders.Set("User-Agent", c.s.userAgent())
  10369. if c.ifNoneMatch_ != "" {
  10370. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10371. }
  10372. var body io.Reader = nil
  10373. c.urlParams_.Set("alt", alt)
  10374. c.urlParams_.Set("prettyPrint", "false")
  10375. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions")
  10376. urls += "?" + c.urlParams_.Encode()
  10377. req, err := http.NewRequest("GET", urls, body)
  10378. if err != nil {
  10379. return nil, err
  10380. }
  10381. req.Header = reqHeaders
  10382. googleapi.Expand(req.URL, map[string]string{
  10383. "enterpriseId": c.enterpriseId,
  10384. "productId": c.productId,
  10385. })
  10386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10387. }
  10388. // Do executes the "androidenterprise.products.getPermissions" call.
  10389. // Exactly one of *ProductPermissions or error will be non-nil. Any
  10390. // non-2xx status code is an error. Response headers are in either
  10391. // *ProductPermissions.ServerResponse.Header or (if a response was
  10392. // returned at all) in error.(*googleapi.Error).Header. Use
  10393. // googleapi.IsNotModified to check whether the returned error was
  10394. // because http.StatusNotModified was returned.
  10395. func (c *ProductsGetPermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) {
  10396. gensupport.SetOptions(c.urlParams_, opts...)
  10397. res, err := c.doRequest("json")
  10398. if res != nil && res.StatusCode == http.StatusNotModified {
  10399. if res.Body != nil {
  10400. res.Body.Close()
  10401. }
  10402. return nil, &googleapi.Error{
  10403. Code: res.StatusCode,
  10404. Header: res.Header,
  10405. }
  10406. }
  10407. if err != nil {
  10408. return nil, err
  10409. }
  10410. defer googleapi.CloseBody(res)
  10411. if err := googleapi.CheckResponse(res); err != nil {
  10412. return nil, err
  10413. }
  10414. ret := &ProductPermissions{
  10415. ServerResponse: googleapi.ServerResponse{
  10416. Header: res.Header,
  10417. HTTPStatusCode: res.StatusCode,
  10418. },
  10419. }
  10420. target := &ret
  10421. if err := gensupport.DecodeResponse(target, res); err != nil {
  10422. return nil, err
  10423. }
  10424. return ret, nil
  10425. // {
  10426. // "description": "Retrieves the Android app permissions required by this app.",
  10427. // "httpMethod": "GET",
  10428. // "id": "androidenterprise.products.getPermissions",
  10429. // "parameterOrder": [
  10430. // "enterpriseId",
  10431. // "productId"
  10432. // ],
  10433. // "parameters": {
  10434. // "enterpriseId": {
  10435. // "description": "The ID of the enterprise.",
  10436. // "location": "path",
  10437. // "required": true,
  10438. // "type": "string"
  10439. // },
  10440. // "productId": {
  10441. // "description": "The ID of the product.",
  10442. // "location": "path",
  10443. // "required": true,
  10444. // "type": "string"
  10445. // }
  10446. // },
  10447. // "path": "enterprises/{enterpriseId}/products/{productId}/permissions",
  10448. // "response": {
  10449. // "$ref": "ProductPermissions"
  10450. // },
  10451. // "scopes": [
  10452. // "https://www.googleapis.com/auth/androidenterprise"
  10453. // ]
  10454. // }
  10455. }
  10456. // method id "androidenterprise.products.list":
  10457. type ProductsListCall struct {
  10458. s *Service
  10459. enterpriseId string
  10460. urlParams_ gensupport.URLParams
  10461. ifNoneMatch_ string
  10462. ctx_ context.Context
  10463. header_ http.Header
  10464. }
  10465. // List: Finds approved products that match a query, or all approved
  10466. // products if there is no query.
  10467. func (r *ProductsService) List(enterpriseId string) *ProductsListCall {
  10468. c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10469. c.enterpriseId = enterpriseId
  10470. return c
  10471. }
  10472. // Approved sets the optional parameter "approved": Specifies whether to
  10473. // search among all products (false) or among only products that have
  10474. // been approved (true). Only "true" is supported, and should be
  10475. // specified.
  10476. func (c *ProductsListCall) Approved(approved bool) *ProductsListCall {
  10477. c.urlParams_.Set("approved", fmt.Sprint(approved))
  10478. return c
  10479. }
  10480. // Language sets the optional parameter "language": The BCP47 tag for
  10481. // the user's preferred language (e.g. "en-US", "de"). Results are
  10482. // returned in the language best matching the preferred language.
  10483. func (c *ProductsListCall) Language(language string) *ProductsListCall {
  10484. c.urlParams_.Set("language", language)
  10485. return c
  10486. }
  10487. // MaxResults sets the optional parameter "maxResults": Specifies the
  10488. // maximum number of products that can be returned per request. If not
  10489. // specified, uses a default value of 100, which is also the maximum
  10490. // retrievable within a single response.
  10491. func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall {
  10492. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10493. return c
  10494. }
  10495. // Query sets the optional parameter "query": The search query as typed
  10496. // in the Google Play store search box. If omitted, all approved apps
  10497. // will be returned (using the pagination parameters), including apps
  10498. // that are not available in the store (e.g. unpublished apps).
  10499. func (c *ProductsListCall) Query(query string) *ProductsListCall {
  10500. c.urlParams_.Set("query", query)
  10501. return c
  10502. }
  10503. // Token sets the optional parameter "token": A pagination token is
  10504. // contained in a request's response when there are more products. The
  10505. // token can be used in a subsequent request to obtain more products,
  10506. // and so forth. This parameter cannot be used in the initial request.
  10507. func (c *ProductsListCall) Token(token string) *ProductsListCall {
  10508. c.urlParams_.Set("token", token)
  10509. return c
  10510. }
  10511. // Fields allows partial responses to be retrieved. See
  10512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10513. // for more information.
  10514. func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall {
  10515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10516. return c
  10517. }
  10518. // IfNoneMatch sets the optional parameter which makes the operation
  10519. // fail if the object's ETag matches the given value. This is useful for
  10520. // getting updates only after the object has changed since the last
  10521. // request. Use googleapi.IsNotModified to check whether the response
  10522. // error from Do is the result of In-None-Match.
  10523. func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall {
  10524. c.ifNoneMatch_ = entityTag
  10525. return c
  10526. }
  10527. // Context sets the context to be used in this call's Do method. Any
  10528. // pending HTTP request will be aborted if the provided context is
  10529. // canceled.
  10530. func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall {
  10531. c.ctx_ = ctx
  10532. return c
  10533. }
  10534. // Header returns an http.Header that can be modified by the caller to
  10535. // add HTTP headers to the request.
  10536. func (c *ProductsListCall) Header() http.Header {
  10537. if c.header_ == nil {
  10538. c.header_ = make(http.Header)
  10539. }
  10540. return c.header_
  10541. }
  10542. func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) {
  10543. reqHeaders := make(http.Header)
  10544. for k, v := range c.header_ {
  10545. reqHeaders[k] = v
  10546. }
  10547. reqHeaders.Set("User-Agent", c.s.userAgent())
  10548. if c.ifNoneMatch_ != "" {
  10549. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10550. }
  10551. var body io.Reader = nil
  10552. c.urlParams_.Set("alt", alt)
  10553. c.urlParams_.Set("prettyPrint", "false")
  10554. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products")
  10555. urls += "?" + c.urlParams_.Encode()
  10556. req, err := http.NewRequest("GET", urls, body)
  10557. if err != nil {
  10558. return nil, err
  10559. }
  10560. req.Header = reqHeaders
  10561. googleapi.Expand(req.URL, map[string]string{
  10562. "enterpriseId": c.enterpriseId,
  10563. })
  10564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10565. }
  10566. // Do executes the "androidenterprise.products.list" call.
  10567. // Exactly one of *ProductsListResponse or error will be non-nil. Any
  10568. // non-2xx status code is an error. Response headers are in either
  10569. // *ProductsListResponse.ServerResponse.Header or (if a response was
  10570. // returned at all) in error.(*googleapi.Error).Header. Use
  10571. // googleapi.IsNotModified to check whether the returned error was
  10572. // because http.StatusNotModified was returned.
  10573. func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) {
  10574. gensupport.SetOptions(c.urlParams_, opts...)
  10575. res, err := c.doRequest("json")
  10576. if res != nil && res.StatusCode == http.StatusNotModified {
  10577. if res.Body != nil {
  10578. res.Body.Close()
  10579. }
  10580. return nil, &googleapi.Error{
  10581. Code: res.StatusCode,
  10582. Header: res.Header,
  10583. }
  10584. }
  10585. if err != nil {
  10586. return nil, err
  10587. }
  10588. defer googleapi.CloseBody(res)
  10589. if err := googleapi.CheckResponse(res); err != nil {
  10590. return nil, err
  10591. }
  10592. ret := &ProductsListResponse{
  10593. ServerResponse: googleapi.ServerResponse{
  10594. Header: res.Header,
  10595. HTTPStatusCode: res.StatusCode,
  10596. },
  10597. }
  10598. target := &ret
  10599. if err := gensupport.DecodeResponse(target, res); err != nil {
  10600. return nil, err
  10601. }
  10602. return ret, nil
  10603. // {
  10604. // "description": "Finds approved products that match a query, or all approved products if there is no query.",
  10605. // "httpMethod": "GET",
  10606. // "id": "androidenterprise.products.list",
  10607. // "parameterOrder": [
  10608. // "enterpriseId"
  10609. // ],
  10610. // "parameters": {
  10611. // "approved": {
  10612. // "description": "Specifies whether to search among all products (false) or among only products that have been approved (true). Only \"true\" is supported, and should be specified.",
  10613. // "location": "query",
  10614. // "type": "boolean"
  10615. // },
  10616. // "enterpriseId": {
  10617. // "description": "The ID of the enterprise.",
  10618. // "location": "path",
  10619. // "required": true,
  10620. // "type": "string"
  10621. // },
  10622. // "language": {
  10623. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\"). Results are returned in the language best matching the preferred language.",
  10624. // "location": "query",
  10625. // "type": "string"
  10626. // },
  10627. // "maxResults": {
  10628. // "description": "Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum retrievable within a single response.",
  10629. // "format": "uint32",
  10630. // "location": "query",
  10631. // "type": "integer"
  10632. // },
  10633. // "query": {
  10634. // "description": "The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps).",
  10635. // "location": "query",
  10636. // "type": "string"
  10637. // },
  10638. // "token": {
  10639. // "description": "A pagination token is contained in a request's response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request.",
  10640. // "location": "query",
  10641. // "type": "string"
  10642. // }
  10643. // },
  10644. // "path": "enterprises/{enterpriseId}/products",
  10645. // "response": {
  10646. // "$ref": "ProductsListResponse"
  10647. // },
  10648. // "scopes": [
  10649. // "https://www.googleapis.com/auth/androidenterprise"
  10650. // ]
  10651. // }
  10652. }
  10653. // method id "androidenterprise.products.unapprove":
  10654. type ProductsUnapproveCall struct {
  10655. s *Service
  10656. enterpriseId string
  10657. productId string
  10658. urlParams_ gensupport.URLParams
  10659. ctx_ context.Context
  10660. header_ http.Header
  10661. }
  10662. // Unapprove: Unapproves the specified product (and the relevant app
  10663. // permissions, if any)
  10664. func (r *ProductsService) Unapprove(enterpriseId string, productId string) *ProductsUnapproveCall {
  10665. c := &ProductsUnapproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10666. c.enterpriseId = enterpriseId
  10667. c.productId = productId
  10668. return c
  10669. }
  10670. // Fields allows partial responses to be retrieved. See
  10671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10672. // for more information.
  10673. func (c *ProductsUnapproveCall) Fields(s ...googleapi.Field) *ProductsUnapproveCall {
  10674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10675. return c
  10676. }
  10677. // Context sets the context to be used in this call's Do method. Any
  10678. // pending HTTP request will be aborted if the provided context is
  10679. // canceled.
  10680. func (c *ProductsUnapproveCall) Context(ctx context.Context) *ProductsUnapproveCall {
  10681. c.ctx_ = ctx
  10682. return c
  10683. }
  10684. // Header returns an http.Header that can be modified by the caller to
  10685. // add HTTP headers to the request.
  10686. func (c *ProductsUnapproveCall) Header() http.Header {
  10687. if c.header_ == nil {
  10688. c.header_ = make(http.Header)
  10689. }
  10690. return c.header_
  10691. }
  10692. func (c *ProductsUnapproveCall) doRequest(alt string) (*http.Response, error) {
  10693. reqHeaders := make(http.Header)
  10694. for k, v := range c.header_ {
  10695. reqHeaders[k] = v
  10696. }
  10697. reqHeaders.Set("User-Agent", c.s.userAgent())
  10698. var body io.Reader = nil
  10699. c.urlParams_.Set("alt", alt)
  10700. c.urlParams_.Set("prettyPrint", "false")
  10701. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/unapprove")
  10702. urls += "?" + c.urlParams_.Encode()
  10703. req, err := http.NewRequest("POST", urls, body)
  10704. if err != nil {
  10705. return nil, err
  10706. }
  10707. req.Header = reqHeaders
  10708. googleapi.Expand(req.URL, map[string]string{
  10709. "enterpriseId": c.enterpriseId,
  10710. "productId": c.productId,
  10711. })
  10712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10713. }
  10714. // Do executes the "androidenterprise.products.unapprove" call.
  10715. func (c *ProductsUnapproveCall) Do(opts ...googleapi.CallOption) error {
  10716. gensupport.SetOptions(c.urlParams_, opts...)
  10717. res, err := c.doRequest("json")
  10718. if err != nil {
  10719. return err
  10720. }
  10721. defer googleapi.CloseBody(res)
  10722. if err := googleapi.CheckResponse(res); err != nil {
  10723. return err
  10724. }
  10725. return nil
  10726. // {
  10727. // "description": "Unapproves the specified product (and the relevant app permissions, if any)",
  10728. // "httpMethod": "POST",
  10729. // "id": "androidenterprise.products.unapprove",
  10730. // "parameterOrder": [
  10731. // "enterpriseId",
  10732. // "productId"
  10733. // ],
  10734. // "parameters": {
  10735. // "enterpriseId": {
  10736. // "description": "The ID of the enterprise.",
  10737. // "location": "path",
  10738. // "required": true,
  10739. // "type": "string"
  10740. // },
  10741. // "productId": {
  10742. // "description": "The ID of the product.",
  10743. // "location": "path",
  10744. // "required": true,
  10745. // "type": "string"
  10746. // }
  10747. // },
  10748. // "path": "enterprises/{enterpriseId}/products/{productId}/unapprove",
  10749. // "scopes": [
  10750. // "https://www.googleapis.com/auth/androidenterprise"
  10751. // ]
  10752. // }
  10753. }
  10754. // method id "androidenterprise.serviceaccountkeys.delete":
  10755. type ServiceaccountkeysDeleteCall struct {
  10756. s *Service
  10757. enterpriseId string
  10758. keyId string
  10759. urlParams_ gensupport.URLParams
  10760. ctx_ context.Context
  10761. header_ http.Header
  10762. }
  10763. // Delete: Removes and invalidates the specified credentials for the
  10764. // service account associated with this enterprise. The calling service
  10765. // account must have been retrieved by calling
  10766. // Enterprises.GetServiceAccount and must have been set as the
  10767. // enterprise service account by calling Enterprises.SetAccount.
  10768. func (r *ServiceaccountkeysService) Delete(enterpriseId string, keyId string) *ServiceaccountkeysDeleteCall {
  10769. c := &ServiceaccountkeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10770. c.enterpriseId = enterpriseId
  10771. c.keyId = keyId
  10772. return c
  10773. }
  10774. // Fields allows partial responses to be retrieved. See
  10775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10776. // for more information.
  10777. func (c *ServiceaccountkeysDeleteCall) Fields(s ...googleapi.Field) *ServiceaccountkeysDeleteCall {
  10778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10779. return c
  10780. }
  10781. // Context sets the context to be used in this call's Do method. Any
  10782. // pending HTTP request will be aborted if the provided context is
  10783. // canceled.
  10784. func (c *ServiceaccountkeysDeleteCall) Context(ctx context.Context) *ServiceaccountkeysDeleteCall {
  10785. c.ctx_ = ctx
  10786. return c
  10787. }
  10788. // Header returns an http.Header that can be modified by the caller to
  10789. // add HTTP headers to the request.
  10790. func (c *ServiceaccountkeysDeleteCall) Header() http.Header {
  10791. if c.header_ == nil {
  10792. c.header_ = make(http.Header)
  10793. }
  10794. return c.header_
  10795. }
  10796. func (c *ServiceaccountkeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  10797. reqHeaders := make(http.Header)
  10798. for k, v := range c.header_ {
  10799. reqHeaders[k] = v
  10800. }
  10801. reqHeaders.Set("User-Agent", c.s.userAgent())
  10802. var body io.Reader = nil
  10803. c.urlParams_.Set("alt", alt)
  10804. c.urlParams_.Set("prettyPrint", "false")
  10805. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys/{keyId}")
  10806. urls += "?" + c.urlParams_.Encode()
  10807. req, err := http.NewRequest("DELETE", urls, body)
  10808. if err != nil {
  10809. return nil, err
  10810. }
  10811. req.Header = reqHeaders
  10812. googleapi.Expand(req.URL, map[string]string{
  10813. "enterpriseId": c.enterpriseId,
  10814. "keyId": c.keyId,
  10815. })
  10816. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10817. }
  10818. // Do executes the "androidenterprise.serviceaccountkeys.delete" call.
  10819. func (c *ServiceaccountkeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  10820. gensupport.SetOptions(c.urlParams_, opts...)
  10821. res, err := c.doRequest("json")
  10822. if err != nil {
  10823. return err
  10824. }
  10825. defer googleapi.CloseBody(res)
  10826. if err := googleapi.CheckResponse(res); err != nil {
  10827. return err
  10828. }
  10829. return nil
  10830. // {
  10831. // "description": "Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.",
  10832. // "httpMethod": "DELETE",
  10833. // "id": "androidenterprise.serviceaccountkeys.delete",
  10834. // "parameterOrder": [
  10835. // "enterpriseId",
  10836. // "keyId"
  10837. // ],
  10838. // "parameters": {
  10839. // "enterpriseId": {
  10840. // "description": "The ID of the enterprise.",
  10841. // "location": "path",
  10842. // "required": true,
  10843. // "type": "string"
  10844. // },
  10845. // "keyId": {
  10846. // "description": "The ID of the key.",
  10847. // "location": "path",
  10848. // "required": true,
  10849. // "type": "string"
  10850. // }
  10851. // },
  10852. // "path": "enterprises/{enterpriseId}/serviceAccountKeys/{keyId}",
  10853. // "scopes": [
  10854. // "https://www.googleapis.com/auth/androidenterprise"
  10855. // ]
  10856. // }
  10857. }
  10858. // method id "androidenterprise.serviceaccountkeys.insert":
  10859. type ServiceaccountkeysInsertCall struct {
  10860. s *Service
  10861. enterpriseId string
  10862. serviceaccountkey *ServiceAccountKey
  10863. urlParams_ gensupport.URLParams
  10864. ctx_ context.Context
  10865. header_ http.Header
  10866. }
  10867. // Insert: Generates new credentials for the service account associated
  10868. // with this enterprise. The calling service account must have been
  10869. // retrieved by calling Enterprises.GetServiceAccount and must have been
  10870. // set as the enterprise service account by calling
  10871. // Enterprises.SetAccount.
  10872. //
  10873. // Only the type of the key should be populated in the resource to be
  10874. // inserted.
  10875. func (r *ServiceaccountkeysService) Insert(enterpriseId string, serviceaccountkey *ServiceAccountKey) *ServiceaccountkeysInsertCall {
  10876. c := &ServiceaccountkeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10877. c.enterpriseId = enterpriseId
  10878. c.serviceaccountkey = serviceaccountkey
  10879. return c
  10880. }
  10881. // Fields allows partial responses to be retrieved. See
  10882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10883. // for more information.
  10884. func (c *ServiceaccountkeysInsertCall) Fields(s ...googleapi.Field) *ServiceaccountkeysInsertCall {
  10885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10886. return c
  10887. }
  10888. // Context sets the context to be used in this call's Do method. Any
  10889. // pending HTTP request will be aborted if the provided context is
  10890. // canceled.
  10891. func (c *ServiceaccountkeysInsertCall) Context(ctx context.Context) *ServiceaccountkeysInsertCall {
  10892. c.ctx_ = ctx
  10893. return c
  10894. }
  10895. // Header returns an http.Header that can be modified by the caller to
  10896. // add HTTP headers to the request.
  10897. func (c *ServiceaccountkeysInsertCall) Header() http.Header {
  10898. if c.header_ == nil {
  10899. c.header_ = make(http.Header)
  10900. }
  10901. return c.header_
  10902. }
  10903. func (c *ServiceaccountkeysInsertCall) doRequest(alt string) (*http.Response, error) {
  10904. reqHeaders := make(http.Header)
  10905. for k, v := range c.header_ {
  10906. reqHeaders[k] = v
  10907. }
  10908. reqHeaders.Set("User-Agent", c.s.userAgent())
  10909. var body io.Reader = nil
  10910. body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccountkey)
  10911. if err != nil {
  10912. return nil, err
  10913. }
  10914. reqHeaders.Set("Content-Type", "application/json")
  10915. c.urlParams_.Set("alt", alt)
  10916. c.urlParams_.Set("prettyPrint", "false")
  10917. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys")
  10918. urls += "?" + c.urlParams_.Encode()
  10919. req, err := http.NewRequest("POST", urls, body)
  10920. if err != nil {
  10921. return nil, err
  10922. }
  10923. req.Header = reqHeaders
  10924. googleapi.Expand(req.URL, map[string]string{
  10925. "enterpriseId": c.enterpriseId,
  10926. })
  10927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10928. }
  10929. // Do executes the "androidenterprise.serviceaccountkeys.insert" call.
  10930. // Exactly one of *ServiceAccountKey or error will be non-nil. Any
  10931. // non-2xx status code is an error. Response headers are in either
  10932. // *ServiceAccountKey.ServerResponse.Header or (if a response was
  10933. // returned at all) in error.(*googleapi.Error).Header. Use
  10934. // googleapi.IsNotModified to check whether the returned error was
  10935. // because http.StatusNotModified was returned.
  10936. func (c *ServiceaccountkeysInsertCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKey, error) {
  10937. gensupport.SetOptions(c.urlParams_, opts...)
  10938. res, err := c.doRequest("json")
  10939. if res != nil && res.StatusCode == http.StatusNotModified {
  10940. if res.Body != nil {
  10941. res.Body.Close()
  10942. }
  10943. return nil, &googleapi.Error{
  10944. Code: res.StatusCode,
  10945. Header: res.Header,
  10946. }
  10947. }
  10948. if err != nil {
  10949. return nil, err
  10950. }
  10951. defer googleapi.CloseBody(res)
  10952. if err := googleapi.CheckResponse(res); err != nil {
  10953. return nil, err
  10954. }
  10955. ret := &ServiceAccountKey{
  10956. ServerResponse: googleapi.ServerResponse{
  10957. Header: res.Header,
  10958. HTTPStatusCode: res.StatusCode,
  10959. },
  10960. }
  10961. target := &ret
  10962. if err := gensupport.DecodeResponse(target, res); err != nil {
  10963. return nil, err
  10964. }
  10965. return ret, nil
  10966. // {
  10967. // "description": "Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.\n\nOnly the type of the key should be populated in the resource to be inserted.",
  10968. // "httpMethod": "POST",
  10969. // "id": "androidenterprise.serviceaccountkeys.insert",
  10970. // "parameterOrder": [
  10971. // "enterpriseId"
  10972. // ],
  10973. // "parameters": {
  10974. // "enterpriseId": {
  10975. // "description": "The ID of the enterprise.",
  10976. // "location": "path",
  10977. // "required": true,
  10978. // "type": "string"
  10979. // }
  10980. // },
  10981. // "path": "enterprises/{enterpriseId}/serviceAccountKeys",
  10982. // "request": {
  10983. // "$ref": "ServiceAccountKey"
  10984. // },
  10985. // "response": {
  10986. // "$ref": "ServiceAccountKey"
  10987. // },
  10988. // "scopes": [
  10989. // "https://www.googleapis.com/auth/androidenterprise"
  10990. // ]
  10991. // }
  10992. }
  10993. // method id "androidenterprise.serviceaccountkeys.list":
  10994. type ServiceaccountkeysListCall struct {
  10995. s *Service
  10996. enterpriseId string
  10997. urlParams_ gensupport.URLParams
  10998. ifNoneMatch_ string
  10999. ctx_ context.Context
  11000. header_ http.Header
  11001. }
  11002. // List: Lists all active credentials for the service account associated
  11003. // with this enterprise. Only the ID and key type are returned. The
  11004. // calling service account must have been retrieved by calling
  11005. // Enterprises.GetServiceAccount and must have been set as the
  11006. // enterprise service account by calling Enterprises.SetAccount.
  11007. func (r *ServiceaccountkeysService) List(enterpriseId string) *ServiceaccountkeysListCall {
  11008. c := &ServiceaccountkeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11009. c.enterpriseId = enterpriseId
  11010. return c
  11011. }
  11012. // Fields allows partial responses to be retrieved. See
  11013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11014. // for more information.
  11015. func (c *ServiceaccountkeysListCall) Fields(s ...googleapi.Field) *ServiceaccountkeysListCall {
  11016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11017. return c
  11018. }
  11019. // IfNoneMatch sets the optional parameter which makes the operation
  11020. // fail if the object's ETag matches the given value. This is useful for
  11021. // getting updates only after the object has changed since the last
  11022. // request. Use googleapi.IsNotModified to check whether the response
  11023. // error from Do is the result of In-None-Match.
  11024. func (c *ServiceaccountkeysListCall) IfNoneMatch(entityTag string) *ServiceaccountkeysListCall {
  11025. c.ifNoneMatch_ = entityTag
  11026. return c
  11027. }
  11028. // Context sets the context to be used in this call's Do method. Any
  11029. // pending HTTP request will be aborted if the provided context is
  11030. // canceled.
  11031. func (c *ServiceaccountkeysListCall) Context(ctx context.Context) *ServiceaccountkeysListCall {
  11032. c.ctx_ = ctx
  11033. return c
  11034. }
  11035. // Header returns an http.Header that can be modified by the caller to
  11036. // add HTTP headers to the request.
  11037. func (c *ServiceaccountkeysListCall) Header() http.Header {
  11038. if c.header_ == nil {
  11039. c.header_ = make(http.Header)
  11040. }
  11041. return c.header_
  11042. }
  11043. func (c *ServiceaccountkeysListCall) doRequest(alt string) (*http.Response, error) {
  11044. reqHeaders := make(http.Header)
  11045. for k, v := range c.header_ {
  11046. reqHeaders[k] = v
  11047. }
  11048. reqHeaders.Set("User-Agent", c.s.userAgent())
  11049. if c.ifNoneMatch_ != "" {
  11050. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11051. }
  11052. var body io.Reader = nil
  11053. c.urlParams_.Set("alt", alt)
  11054. c.urlParams_.Set("prettyPrint", "false")
  11055. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys")
  11056. urls += "?" + c.urlParams_.Encode()
  11057. req, err := http.NewRequest("GET", urls, body)
  11058. if err != nil {
  11059. return nil, err
  11060. }
  11061. req.Header = reqHeaders
  11062. googleapi.Expand(req.URL, map[string]string{
  11063. "enterpriseId": c.enterpriseId,
  11064. })
  11065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11066. }
  11067. // Do executes the "androidenterprise.serviceaccountkeys.list" call.
  11068. // Exactly one of *ServiceAccountKeysListResponse or error will be
  11069. // non-nil. Any non-2xx status code is an error. Response headers are in
  11070. // either *ServiceAccountKeysListResponse.ServerResponse.Header or (if a
  11071. // response was returned at all) in error.(*googleapi.Error).Header. Use
  11072. // googleapi.IsNotModified to check whether the returned error was
  11073. // because http.StatusNotModified was returned.
  11074. func (c *ServiceaccountkeysListCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKeysListResponse, error) {
  11075. gensupport.SetOptions(c.urlParams_, opts...)
  11076. res, err := c.doRequest("json")
  11077. if res != nil && res.StatusCode == http.StatusNotModified {
  11078. if res.Body != nil {
  11079. res.Body.Close()
  11080. }
  11081. return nil, &googleapi.Error{
  11082. Code: res.StatusCode,
  11083. Header: res.Header,
  11084. }
  11085. }
  11086. if err != nil {
  11087. return nil, err
  11088. }
  11089. defer googleapi.CloseBody(res)
  11090. if err := googleapi.CheckResponse(res); err != nil {
  11091. return nil, err
  11092. }
  11093. ret := &ServiceAccountKeysListResponse{
  11094. ServerResponse: googleapi.ServerResponse{
  11095. Header: res.Header,
  11096. HTTPStatusCode: res.StatusCode,
  11097. },
  11098. }
  11099. target := &ret
  11100. if err := gensupport.DecodeResponse(target, res); err != nil {
  11101. return nil, err
  11102. }
  11103. return ret, nil
  11104. // {
  11105. // "description": "Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.",
  11106. // "httpMethod": "GET",
  11107. // "id": "androidenterprise.serviceaccountkeys.list",
  11108. // "parameterOrder": [
  11109. // "enterpriseId"
  11110. // ],
  11111. // "parameters": {
  11112. // "enterpriseId": {
  11113. // "description": "The ID of the enterprise.",
  11114. // "location": "path",
  11115. // "required": true,
  11116. // "type": "string"
  11117. // }
  11118. // },
  11119. // "path": "enterprises/{enterpriseId}/serviceAccountKeys",
  11120. // "response": {
  11121. // "$ref": "ServiceAccountKeysListResponse"
  11122. // },
  11123. // "scopes": [
  11124. // "https://www.googleapis.com/auth/androidenterprise"
  11125. // ]
  11126. // }
  11127. }
  11128. // method id "androidenterprise.storelayoutclusters.delete":
  11129. type StorelayoutclustersDeleteCall struct {
  11130. s *Service
  11131. enterpriseId string
  11132. pageId string
  11133. clusterId string
  11134. urlParams_ gensupport.URLParams
  11135. ctx_ context.Context
  11136. header_ http.Header
  11137. }
  11138. // Delete: Deletes a cluster.
  11139. func (r *StorelayoutclustersService) Delete(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersDeleteCall {
  11140. c := &StorelayoutclustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11141. c.enterpriseId = enterpriseId
  11142. c.pageId = pageId
  11143. c.clusterId = clusterId
  11144. return c
  11145. }
  11146. // Fields allows partial responses to be retrieved. See
  11147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11148. // for more information.
  11149. func (c *StorelayoutclustersDeleteCall) Fields(s ...googleapi.Field) *StorelayoutclustersDeleteCall {
  11150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11151. return c
  11152. }
  11153. // Context sets the context to be used in this call's Do method. Any
  11154. // pending HTTP request will be aborted if the provided context is
  11155. // canceled.
  11156. func (c *StorelayoutclustersDeleteCall) Context(ctx context.Context) *StorelayoutclustersDeleteCall {
  11157. c.ctx_ = ctx
  11158. return c
  11159. }
  11160. // Header returns an http.Header that can be modified by the caller to
  11161. // add HTTP headers to the request.
  11162. func (c *StorelayoutclustersDeleteCall) Header() http.Header {
  11163. if c.header_ == nil {
  11164. c.header_ = make(http.Header)
  11165. }
  11166. return c.header_
  11167. }
  11168. func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  11169. reqHeaders := make(http.Header)
  11170. for k, v := range c.header_ {
  11171. reqHeaders[k] = v
  11172. }
  11173. reqHeaders.Set("User-Agent", c.s.userAgent())
  11174. var body io.Reader = nil
  11175. c.urlParams_.Set("alt", alt)
  11176. c.urlParams_.Set("prettyPrint", "false")
  11177. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11178. urls += "?" + c.urlParams_.Encode()
  11179. req, err := http.NewRequest("DELETE", urls, body)
  11180. if err != nil {
  11181. return nil, err
  11182. }
  11183. req.Header = reqHeaders
  11184. googleapi.Expand(req.URL, map[string]string{
  11185. "enterpriseId": c.enterpriseId,
  11186. "pageId": c.pageId,
  11187. "clusterId": c.clusterId,
  11188. })
  11189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11190. }
  11191. // Do executes the "androidenterprise.storelayoutclusters.delete" call.
  11192. func (c *StorelayoutclustersDeleteCall) Do(opts ...googleapi.CallOption) error {
  11193. gensupport.SetOptions(c.urlParams_, opts...)
  11194. res, err := c.doRequest("json")
  11195. if err != nil {
  11196. return err
  11197. }
  11198. defer googleapi.CloseBody(res)
  11199. if err := googleapi.CheckResponse(res); err != nil {
  11200. return err
  11201. }
  11202. return nil
  11203. // {
  11204. // "description": "Deletes a cluster.",
  11205. // "httpMethod": "DELETE",
  11206. // "id": "androidenterprise.storelayoutclusters.delete",
  11207. // "parameterOrder": [
  11208. // "enterpriseId",
  11209. // "pageId",
  11210. // "clusterId"
  11211. // ],
  11212. // "parameters": {
  11213. // "clusterId": {
  11214. // "description": "The ID of the cluster.",
  11215. // "location": "path",
  11216. // "required": true,
  11217. // "type": "string"
  11218. // },
  11219. // "enterpriseId": {
  11220. // "description": "The ID of the enterprise.",
  11221. // "location": "path",
  11222. // "required": true,
  11223. // "type": "string"
  11224. // },
  11225. // "pageId": {
  11226. // "description": "The ID of the page.",
  11227. // "location": "path",
  11228. // "required": true,
  11229. // "type": "string"
  11230. // }
  11231. // },
  11232. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11233. // "scopes": [
  11234. // "https://www.googleapis.com/auth/androidenterprise"
  11235. // ]
  11236. // }
  11237. }
  11238. // method id "androidenterprise.storelayoutclusters.get":
  11239. type StorelayoutclustersGetCall struct {
  11240. s *Service
  11241. enterpriseId string
  11242. pageId string
  11243. clusterId string
  11244. urlParams_ gensupport.URLParams
  11245. ifNoneMatch_ string
  11246. ctx_ context.Context
  11247. header_ http.Header
  11248. }
  11249. // Get: Retrieves details of a cluster.
  11250. func (r *StorelayoutclustersService) Get(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersGetCall {
  11251. c := &StorelayoutclustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11252. c.enterpriseId = enterpriseId
  11253. c.pageId = pageId
  11254. c.clusterId = clusterId
  11255. return c
  11256. }
  11257. // Fields allows partial responses to be retrieved. See
  11258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11259. // for more information.
  11260. func (c *StorelayoutclustersGetCall) Fields(s ...googleapi.Field) *StorelayoutclustersGetCall {
  11261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11262. return c
  11263. }
  11264. // IfNoneMatch sets the optional parameter which makes the operation
  11265. // fail if the object's ETag matches the given value. This is useful for
  11266. // getting updates only after the object has changed since the last
  11267. // request. Use googleapi.IsNotModified to check whether the response
  11268. // error from Do is the result of In-None-Match.
  11269. func (c *StorelayoutclustersGetCall) IfNoneMatch(entityTag string) *StorelayoutclustersGetCall {
  11270. c.ifNoneMatch_ = entityTag
  11271. return c
  11272. }
  11273. // Context sets the context to be used in this call's Do method. Any
  11274. // pending HTTP request will be aborted if the provided context is
  11275. // canceled.
  11276. func (c *StorelayoutclustersGetCall) Context(ctx context.Context) *StorelayoutclustersGetCall {
  11277. c.ctx_ = ctx
  11278. return c
  11279. }
  11280. // Header returns an http.Header that can be modified by the caller to
  11281. // add HTTP headers to the request.
  11282. func (c *StorelayoutclustersGetCall) Header() http.Header {
  11283. if c.header_ == nil {
  11284. c.header_ = make(http.Header)
  11285. }
  11286. return c.header_
  11287. }
  11288. func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, error) {
  11289. reqHeaders := make(http.Header)
  11290. for k, v := range c.header_ {
  11291. reqHeaders[k] = v
  11292. }
  11293. reqHeaders.Set("User-Agent", c.s.userAgent())
  11294. if c.ifNoneMatch_ != "" {
  11295. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11296. }
  11297. var body io.Reader = nil
  11298. c.urlParams_.Set("alt", alt)
  11299. c.urlParams_.Set("prettyPrint", "false")
  11300. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11301. urls += "?" + c.urlParams_.Encode()
  11302. req, err := http.NewRequest("GET", urls, body)
  11303. if err != nil {
  11304. return nil, err
  11305. }
  11306. req.Header = reqHeaders
  11307. googleapi.Expand(req.URL, map[string]string{
  11308. "enterpriseId": c.enterpriseId,
  11309. "pageId": c.pageId,
  11310. "clusterId": c.clusterId,
  11311. })
  11312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11313. }
  11314. // Do executes the "androidenterprise.storelayoutclusters.get" call.
  11315. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11316. // status code is an error. Response headers are in either
  11317. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11318. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11319. // to check whether the returned error was because
  11320. // http.StatusNotModified was returned.
  11321. func (c *StorelayoutclustersGetCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11322. gensupport.SetOptions(c.urlParams_, opts...)
  11323. res, err := c.doRequest("json")
  11324. if res != nil && res.StatusCode == http.StatusNotModified {
  11325. if res.Body != nil {
  11326. res.Body.Close()
  11327. }
  11328. return nil, &googleapi.Error{
  11329. Code: res.StatusCode,
  11330. Header: res.Header,
  11331. }
  11332. }
  11333. if err != nil {
  11334. return nil, err
  11335. }
  11336. defer googleapi.CloseBody(res)
  11337. if err := googleapi.CheckResponse(res); err != nil {
  11338. return nil, err
  11339. }
  11340. ret := &StoreCluster{
  11341. ServerResponse: googleapi.ServerResponse{
  11342. Header: res.Header,
  11343. HTTPStatusCode: res.StatusCode,
  11344. },
  11345. }
  11346. target := &ret
  11347. if err := gensupport.DecodeResponse(target, res); err != nil {
  11348. return nil, err
  11349. }
  11350. return ret, nil
  11351. // {
  11352. // "description": "Retrieves details of a cluster.",
  11353. // "httpMethod": "GET",
  11354. // "id": "androidenterprise.storelayoutclusters.get",
  11355. // "parameterOrder": [
  11356. // "enterpriseId",
  11357. // "pageId",
  11358. // "clusterId"
  11359. // ],
  11360. // "parameters": {
  11361. // "clusterId": {
  11362. // "description": "The ID of the cluster.",
  11363. // "location": "path",
  11364. // "required": true,
  11365. // "type": "string"
  11366. // },
  11367. // "enterpriseId": {
  11368. // "description": "The ID of the enterprise.",
  11369. // "location": "path",
  11370. // "required": true,
  11371. // "type": "string"
  11372. // },
  11373. // "pageId": {
  11374. // "description": "The ID of the page.",
  11375. // "location": "path",
  11376. // "required": true,
  11377. // "type": "string"
  11378. // }
  11379. // },
  11380. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11381. // "response": {
  11382. // "$ref": "StoreCluster"
  11383. // },
  11384. // "scopes": [
  11385. // "https://www.googleapis.com/auth/androidenterprise"
  11386. // ]
  11387. // }
  11388. }
  11389. // method id "androidenterprise.storelayoutclusters.insert":
  11390. type StorelayoutclustersInsertCall struct {
  11391. s *Service
  11392. enterpriseId string
  11393. pageId string
  11394. storecluster *StoreCluster
  11395. urlParams_ gensupport.URLParams
  11396. ctx_ context.Context
  11397. header_ http.Header
  11398. }
  11399. // Insert: Inserts a new cluster in a page.
  11400. func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall {
  11401. c := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11402. c.enterpriseId = enterpriseId
  11403. c.pageId = pageId
  11404. c.storecluster = storecluster
  11405. return c
  11406. }
  11407. // Fields allows partial responses to be retrieved. See
  11408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11409. // for more information.
  11410. func (c *StorelayoutclustersInsertCall) Fields(s ...googleapi.Field) *StorelayoutclustersInsertCall {
  11411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11412. return c
  11413. }
  11414. // Context sets the context to be used in this call's Do method. Any
  11415. // pending HTTP request will be aborted if the provided context is
  11416. // canceled.
  11417. func (c *StorelayoutclustersInsertCall) Context(ctx context.Context) *StorelayoutclustersInsertCall {
  11418. c.ctx_ = ctx
  11419. return c
  11420. }
  11421. // Header returns an http.Header that can be modified by the caller to
  11422. // add HTTP headers to the request.
  11423. func (c *StorelayoutclustersInsertCall) Header() http.Header {
  11424. if c.header_ == nil {
  11425. c.header_ = make(http.Header)
  11426. }
  11427. return c.header_
  11428. }
  11429. func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) {
  11430. reqHeaders := make(http.Header)
  11431. for k, v := range c.header_ {
  11432. reqHeaders[k] = v
  11433. }
  11434. reqHeaders.Set("User-Agent", c.s.userAgent())
  11435. var body io.Reader = nil
  11436. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
  11437. if err != nil {
  11438. return nil, err
  11439. }
  11440. reqHeaders.Set("Content-Type", "application/json")
  11441. c.urlParams_.Set("alt", alt)
  11442. c.urlParams_.Set("prettyPrint", "false")
  11443. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters")
  11444. urls += "?" + c.urlParams_.Encode()
  11445. req, err := http.NewRequest("POST", urls, body)
  11446. if err != nil {
  11447. return nil, err
  11448. }
  11449. req.Header = reqHeaders
  11450. googleapi.Expand(req.URL, map[string]string{
  11451. "enterpriseId": c.enterpriseId,
  11452. "pageId": c.pageId,
  11453. })
  11454. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11455. }
  11456. // Do executes the "androidenterprise.storelayoutclusters.insert" call.
  11457. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11458. // status code is an error. Response headers are in either
  11459. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11460. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11461. // to check whether the returned error was because
  11462. // http.StatusNotModified was returned.
  11463. func (c *StorelayoutclustersInsertCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11464. gensupport.SetOptions(c.urlParams_, opts...)
  11465. res, err := c.doRequest("json")
  11466. if res != nil && res.StatusCode == http.StatusNotModified {
  11467. if res.Body != nil {
  11468. res.Body.Close()
  11469. }
  11470. return nil, &googleapi.Error{
  11471. Code: res.StatusCode,
  11472. Header: res.Header,
  11473. }
  11474. }
  11475. if err != nil {
  11476. return nil, err
  11477. }
  11478. defer googleapi.CloseBody(res)
  11479. if err := googleapi.CheckResponse(res); err != nil {
  11480. return nil, err
  11481. }
  11482. ret := &StoreCluster{
  11483. ServerResponse: googleapi.ServerResponse{
  11484. Header: res.Header,
  11485. HTTPStatusCode: res.StatusCode,
  11486. },
  11487. }
  11488. target := &ret
  11489. if err := gensupport.DecodeResponse(target, res); err != nil {
  11490. return nil, err
  11491. }
  11492. return ret, nil
  11493. // {
  11494. // "description": "Inserts a new cluster in a page.",
  11495. // "httpMethod": "POST",
  11496. // "id": "androidenterprise.storelayoutclusters.insert",
  11497. // "parameterOrder": [
  11498. // "enterpriseId",
  11499. // "pageId"
  11500. // ],
  11501. // "parameters": {
  11502. // "enterpriseId": {
  11503. // "description": "The ID of the enterprise.",
  11504. // "location": "path",
  11505. // "required": true,
  11506. // "type": "string"
  11507. // },
  11508. // "pageId": {
  11509. // "description": "The ID of the page.",
  11510. // "location": "path",
  11511. // "required": true,
  11512. // "type": "string"
  11513. // }
  11514. // },
  11515. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters",
  11516. // "request": {
  11517. // "$ref": "StoreCluster"
  11518. // },
  11519. // "response": {
  11520. // "$ref": "StoreCluster"
  11521. // },
  11522. // "scopes": [
  11523. // "https://www.googleapis.com/auth/androidenterprise"
  11524. // ]
  11525. // }
  11526. }
  11527. // method id "androidenterprise.storelayoutclusters.list":
  11528. type StorelayoutclustersListCall struct {
  11529. s *Service
  11530. enterpriseId string
  11531. pageId string
  11532. urlParams_ gensupport.URLParams
  11533. ifNoneMatch_ string
  11534. ctx_ context.Context
  11535. header_ http.Header
  11536. }
  11537. // List: Retrieves the details of all clusters on the specified page.
  11538. func (r *StorelayoutclustersService) List(enterpriseId string, pageId string) *StorelayoutclustersListCall {
  11539. c := &StorelayoutclustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11540. c.enterpriseId = enterpriseId
  11541. c.pageId = pageId
  11542. return c
  11543. }
  11544. // Fields allows partial responses to be retrieved. See
  11545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11546. // for more information.
  11547. func (c *StorelayoutclustersListCall) Fields(s ...googleapi.Field) *StorelayoutclustersListCall {
  11548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11549. return c
  11550. }
  11551. // IfNoneMatch sets the optional parameter which makes the operation
  11552. // fail if the object's ETag matches the given value. This is useful for
  11553. // getting updates only after the object has changed since the last
  11554. // request. Use googleapi.IsNotModified to check whether the response
  11555. // error from Do is the result of In-None-Match.
  11556. func (c *StorelayoutclustersListCall) IfNoneMatch(entityTag string) *StorelayoutclustersListCall {
  11557. c.ifNoneMatch_ = entityTag
  11558. return c
  11559. }
  11560. // Context sets the context to be used in this call's Do method. Any
  11561. // pending HTTP request will be aborted if the provided context is
  11562. // canceled.
  11563. func (c *StorelayoutclustersListCall) Context(ctx context.Context) *StorelayoutclustersListCall {
  11564. c.ctx_ = ctx
  11565. return c
  11566. }
  11567. // Header returns an http.Header that can be modified by the caller to
  11568. // add HTTP headers to the request.
  11569. func (c *StorelayoutclustersListCall) Header() http.Header {
  11570. if c.header_ == nil {
  11571. c.header_ = make(http.Header)
  11572. }
  11573. return c.header_
  11574. }
  11575. func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, error) {
  11576. reqHeaders := make(http.Header)
  11577. for k, v := range c.header_ {
  11578. reqHeaders[k] = v
  11579. }
  11580. reqHeaders.Set("User-Agent", c.s.userAgent())
  11581. if c.ifNoneMatch_ != "" {
  11582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11583. }
  11584. var body io.Reader = nil
  11585. c.urlParams_.Set("alt", alt)
  11586. c.urlParams_.Set("prettyPrint", "false")
  11587. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters")
  11588. urls += "?" + c.urlParams_.Encode()
  11589. req, err := http.NewRequest("GET", urls, body)
  11590. if err != nil {
  11591. return nil, err
  11592. }
  11593. req.Header = reqHeaders
  11594. googleapi.Expand(req.URL, map[string]string{
  11595. "enterpriseId": c.enterpriseId,
  11596. "pageId": c.pageId,
  11597. })
  11598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11599. }
  11600. // Do executes the "androidenterprise.storelayoutclusters.list" call.
  11601. // Exactly one of *StoreLayoutClustersListResponse or error will be
  11602. // non-nil. Any non-2xx status code is an error. Response headers are in
  11603. // either *StoreLayoutClustersListResponse.ServerResponse.Header or (if
  11604. // a response was returned at all) in error.(*googleapi.Error).Header.
  11605. // Use googleapi.IsNotModified to check whether the returned error was
  11606. // because http.StatusNotModified was returned.
  11607. func (c *StorelayoutclustersListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutClustersListResponse, error) {
  11608. gensupport.SetOptions(c.urlParams_, opts...)
  11609. res, err := c.doRequest("json")
  11610. if res != nil && res.StatusCode == http.StatusNotModified {
  11611. if res.Body != nil {
  11612. res.Body.Close()
  11613. }
  11614. return nil, &googleapi.Error{
  11615. Code: res.StatusCode,
  11616. Header: res.Header,
  11617. }
  11618. }
  11619. if err != nil {
  11620. return nil, err
  11621. }
  11622. defer googleapi.CloseBody(res)
  11623. if err := googleapi.CheckResponse(res); err != nil {
  11624. return nil, err
  11625. }
  11626. ret := &StoreLayoutClustersListResponse{
  11627. ServerResponse: googleapi.ServerResponse{
  11628. Header: res.Header,
  11629. HTTPStatusCode: res.StatusCode,
  11630. },
  11631. }
  11632. target := &ret
  11633. if err := gensupport.DecodeResponse(target, res); err != nil {
  11634. return nil, err
  11635. }
  11636. return ret, nil
  11637. // {
  11638. // "description": "Retrieves the details of all clusters on the specified page.",
  11639. // "httpMethod": "GET",
  11640. // "id": "androidenterprise.storelayoutclusters.list",
  11641. // "parameterOrder": [
  11642. // "enterpriseId",
  11643. // "pageId"
  11644. // ],
  11645. // "parameters": {
  11646. // "enterpriseId": {
  11647. // "description": "The ID of the enterprise.",
  11648. // "location": "path",
  11649. // "required": true,
  11650. // "type": "string"
  11651. // },
  11652. // "pageId": {
  11653. // "description": "The ID of the page.",
  11654. // "location": "path",
  11655. // "required": true,
  11656. // "type": "string"
  11657. // }
  11658. // },
  11659. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters",
  11660. // "response": {
  11661. // "$ref": "StoreLayoutClustersListResponse"
  11662. // },
  11663. // "scopes": [
  11664. // "https://www.googleapis.com/auth/androidenterprise"
  11665. // ]
  11666. // }
  11667. }
  11668. // method id "androidenterprise.storelayoutclusters.patch":
  11669. type StorelayoutclustersPatchCall struct {
  11670. s *Service
  11671. enterpriseId string
  11672. pageId string
  11673. clusterId string
  11674. storecluster *StoreCluster
  11675. urlParams_ gensupport.URLParams
  11676. ctx_ context.Context
  11677. header_ http.Header
  11678. }
  11679. // Patch: Updates a cluster. This method supports patch semantics.
  11680. func (r *StorelayoutclustersService) Patch(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersPatchCall {
  11681. c := &StorelayoutclustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11682. c.enterpriseId = enterpriseId
  11683. c.pageId = pageId
  11684. c.clusterId = clusterId
  11685. c.storecluster = storecluster
  11686. return c
  11687. }
  11688. // Fields allows partial responses to be retrieved. See
  11689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11690. // for more information.
  11691. func (c *StorelayoutclustersPatchCall) Fields(s ...googleapi.Field) *StorelayoutclustersPatchCall {
  11692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11693. return c
  11694. }
  11695. // Context sets the context to be used in this call's Do method. Any
  11696. // pending HTTP request will be aborted if the provided context is
  11697. // canceled.
  11698. func (c *StorelayoutclustersPatchCall) Context(ctx context.Context) *StorelayoutclustersPatchCall {
  11699. c.ctx_ = ctx
  11700. return c
  11701. }
  11702. // Header returns an http.Header that can be modified by the caller to
  11703. // add HTTP headers to the request.
  11704. func (c *StorelayoutclustersPatchCall) Header() http.Header {
  11705. if c.header_ == nil {
  11706. c.header_ = make(http.Header)
  11707. }
  11708. return c.header_
  11709. }
  11710. func (c *StorelayoutclustersPatchCall) doRequest(alt string) (*http.Response, error) {
  11711. reqHeaders := make(http.Header)
  11712. for k, v := range c.header_ {
  11713. reqHeaders[k] = v
  11714. }
  11715. reqHeaders.Set("User-Agent", c.s.userAgent())
  11716. var body io.Reader = nil
  11717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
  11718. if err != nil {
  11719. return nil, err
  11720. }
  11721. reqHeaders.Set("Content-Type", "application/json")
  11722. c.urlParams_.Set("alt", alt)
  11723. c.urlParams_.Set("prettyPrint", "false")
  11724. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11725. urls += "?" + c.urlParams_.Encode()
  11726. req, err := http.NewRequest("PATCH", urls, body)
  11727. if err != nil {
  11728. return nil, err
  11729. }
  11730. req.Header = reqHeaders
  11731. googleapi.Expand(req.URL, map[string]string{
  11732. "enterpriseId": c.enterpriseId,
  11733. "pageId": c.pageId,
  11734. "clusterId": c.clusterId,
  11735. })
  11736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11737. }
  11738. // Do executes the "androidenterprise.storelayoutclusters.patch" call.
  11739. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11740. // status code is an error. Response headers are in either
  11741. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11742. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11743. // to check whether the returned error was because
  11744. // http.StatusNotModified was returned.
  11745. func (c *StorelayoutclustersPatchCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11746. gensupport.SetOptions(c.urlParams_, opts...)
  11747. res, err := c.doRequest("json")
  11748. if res != nil && res.StatusCode == http.StatusNotModified {
  11749. if res.Body != nil {
  11750. res.Body.Close()
  11751. }
  11752. return nil, &googleapi.Error{
  11753. Code: res.StatusCode,
  11754. Header: res.Header,
  11755. }
  11756. }
  11757. if err != nil {
  11758. return nil, err
  11759. }
  11760. defer googleapi.CloseBody(res)
  11761. if err := googleapi.CheckResponse(res); err != nil {
  11762. return nil, err
  11763. }
  11764. ret := &StoreCluster{
  11765. ServerResponse: googleapi.ServerResponse{
  11766. Header: res.Header,
  11767. HTTPStatusCode: res.StatusCode,
  11768. },
  11769. }
  11770. target := &ret
  11771. if err := gensupport.DecodeResponse(target, res); err != nil {
  11772. return nil, err
  11773. }
  11774. return ret, nil
  11775. // {
  11776. // "description": "Updates a cluster. This method supports patch semantics.",
  11777. // "httpMethod": "PATCH",
  11778. // "id": "androidenterprise.storelayoutclusters.patch",
  11779. // "parameterOrder": [
  11780. // "enterpriseId",
  11781. // "pageId",
  11782. // "clusterId"
  11783. // ],
  11784. // "parameters": {
  11785. // "clusterId": {
  11786. // "description": "The ID of the cluster.",
  11787. // "location": "path",
  11788. // "required": true,
  11789. // "type": "string"
  11790. // },
  11791. // "enterpriseId": {
  11792. // "description": "The ID of the enterprise.",
  11793. // "location": "path",
  11794. // "required": true,
  11795. // "type": "string"
  11796. // },
  11797. // "pageId": {
  11798. // "description": "The ID of the page.",
  11799. // "location": "path",
  11800. // "required": true,
  11801. // "type": "string"
  11802. // }
  11803. // },
  11804. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11805. // "request": {
  11806. // "$ref": "StoreCluster"
  11807. // },
  11808. // "response": {
  11809. // "$ref": "StoreCluster"
  11810. // },
  11811. // "scopes": [
  11812. // "https://www.googleapis.com/auth/androidenterprise"
  11813. // ]
  11814. // }
  11815. }
  11816. // method id "androidenterprise.storelayoutclusters.update":
  11817. type StorelayoutclustersUpdateCall struct {
  11818. s *Service
  11819. enterpriseId string
  11820. pageId string
  11821. clusterId string
  11822. storecluster *StoreCluster
  11823. urlParams_ gensupport.URLParams
  11824. ctx_ context.Context
  11825. header_ http.Header
  11826. }
  11827. // Update: Updates a cluster.
  11828. func (r *StorelayoutclustersService) Update(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersUpdateCall {
  11829. c := &StorelayoutclustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11830. c.enterpriseId = enterpriseId
  11831. c.pageId = pageId
  11832. c.clusterId = clusterId
  11833. c.storecluster = storecluster
  11834. return c
  11835. }
  11836. // Fields allows partial responses to be retrieved. See
  11837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11838. // for more information.
  11839. func (c *StorelayoutclustersUpdateCall) Fields(s ...googleapi.Field) *StorelayoutclustersUpdateCall {
  11840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11841. return c
  11842. }
  11843. // Context sets the context to be used in this call's Do method. Any
  11844. // pending HTTP request will be aborted if the provided context is
  11845. // canceled.
  11846. func (c *StorelayoutclustersUpdateCall) Context(ctx context.Context) *StorelayoutclustersUpdateCall {
  11847. c.ctx_ = ctx
  11848. return c
  11849. }
  11850. // Header returns an http.Header that can be modified by the caller to
  11851. // add HTTP headers to the request.
  11852. func (c *StorelayoutclustersUpdateCall) Header() http.Header {
  11853. if c.header_ == nil {
  11854. c.header_ = make(http.Header)
  11855. }
  11856. return c.header_
  11857. }
  11858. func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  11859. reqHeaders := make(http.Header)
  11860. for k, v := range c.header_ {
  11861. reqHeaders[k] = v
  11862. }
  11863. reqHeaders.Set("User-Agent", c.s.userAgent())
  11864. var body io.Reader = nil
  11865. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
  11866. if err != nil {
  11867. return nil, err
  11868. }
  11869. reqHeaders.Set("Content-Type", "application/json")
  11870. c.urlParams_.Set("alt", alt)
  11871. c.urlParams_.Set("prettyPrint", "false")
  11872. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11873. urls += "?" + c.urlParams_.Encode()
  11874. req, err := http.NewRequest("PUT", urls, body)
  11875. if err != nil {
  11876. return nil, err
  11877. }
  11878. req.Header = reqHeaders
  11879. googleapi.Expand(req.URL, map[string]string{
  11880. "enterpriseId": c.enterpriseId,
  11881. "pageId": c.pageId,
  11882. "clusterId": c.clusterId,
  11883. })
  11884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11885. }
  11886. // Do executes the "androidenterprise.storelayoutclusters.update" call.
  11887. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11888. // status code is an error. Response headers are in either
  11889. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11890. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11891. // to check whether the returned error was because
  11892. // http.StatusNotModified was returned.
  11893. func (c *StorelayoutclustersUpdateCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11894. gensupport.SetOptions(c.urlParams_, opts...)
  11895. res, err := c.doRequest("json")
  11896. if res != nil && res.StatusCode == http.StatusNotModified {
  11897. if res.Body != nil {
  11898. res.Body.Close()
  11899. }
  11900. return nil, &googleapi.Error{
  11901. Code: res.StatusCode,
  11902. Header: res.Header,
  11903. }
  11904. }
  11905. if err != nil {
  11906. return nil, err
  11907. }
  11908. defer googleapi.CloseBody(res)
  11909. if err := googleapi.CheckResponse(res); err != nil {
  11910. return nil, err
  11911. }
  11912. ret := &StoreCluster{
  11913. ServerResponse: googleapi.ServerResponse{
  11914. Header: res.Header,
  11915. HTTPStatusCode: res.StatusCode,
  11916. },
  11917. }
  11918. target := &ret
  11919. if err := gensupport.DecodeResponse(target, res); err != nil {
  11920. return nil, err
  11921. }
  11922. return ret, nil
  11923. // {
  11924. // "description": "Updates a cluster.",
  11925. // "httpMethod": "PUT",
  11926. // "id": "androidenterprise.storelayoutclusters.update",
  11927. // "parameterOrder": [
  11928. // "enterpriseId",
  11929. // "pageId",
  11930. // "clusterId"
  11931. // ],
  11932. // "parameters": {
  11933. // "clusterId": {
  11934. // "description": "The ID of the cluster.",
  11935. // "location": "path",
  11936. // "required": true,
  11937. // "type": "string"
  11938. // },
  11939. // "enterpriseId": {
  11940. // "description": "The ID of the enterprise.",
  11941. // "location": "path",
  11942. // "required": true,
  11943. // "type": "string"
  11944. // },
  11945. // "pageId": {
  11946. // "description": "The ID of the page.",
  11947. // "location": "path",
  11948. // "required": true,
  11949. // "type": "string"
  11950. // }
  11951. // },
  11952. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11953. // "request": {
  11954. // "$ref": "StoreCluster"
  11955. // },
  11956. // "response": {
  11957. // "$ref": "StoreCluster"
  11958. // },
  11959. // "scopes": [
  11960. // "https://www.googleapis.com/auth/androidenterprise"
  11961. // ]
  11962. // }
  11963. }
  11964. // method id "androidenterprise.storelayoutpages.delete":
  11965. type StorelayoutpagesDeleteCall struct {
  11966. s *Service
  11967. enterpriseId string
  11968. pageId string
  11969. urlParams_ gensupport.URLParams
  11970. ctx_ context.Context
  11971. header_ http.Header
  11972. }
  11973. // Delete: Deletes a store page.
  11974. func (r *StorelayoutpagesService) Delete(enterpriseId string, pageId string) *StorelayoutpagesDeleteCall {
  11975. c := &StorelayoutpagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11976. c.enterpriseId = enterpriseId
  11977. c.pageId = pageId
  11978. return c
  11979. }
  11980. // Fields allows partial responses to be retrieved. See
  11981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11982. // for more information.
  11983. func (c *StorelayoutpagesDeleteCall) Fields(s ...googleapi.Field) *StorelayoutpagesDeleteCall {
  11984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11985. return c
  11986. }
  11987. // Context sets the context to be used in this call's Do method. Any
  11988. // pending HTTP request will be aborted if the provided context is
  11989. // canceled.
  11990. func (c *StorelayoutpagesDeleteCall) Context(ctx context.Context) *StorelayoutpagesDeleteCall {
  11991. c.ctx_ = ctx
  11992. return c
  11993. }
  11994. // Header returns an http.Header that can be modified by the caller to
  11995. // add HTTP headers to the request.
  11996. func (c *StorelayoutpagesDeleteCall) Header() http.Header {
  11997. if c.header_ == nil {
  11998. c.header_ = make(http.Header)
  11999. }
  12000. return c.header_
  12001. }
  12002. func (c *StorelayoutpagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12003. reqHeaders := make(http.Header)
  12004. for k, v := range c.header_ {
  12005. reqHeaders[k] = v
  12006. }
  12007. reqHeaders.Set("User-Agent", c.s.userAgent())
  12008. var body io.Reader = nil
  12009. c.urlParams_.Set("alt", alt)
  12010. c.urlParams_.Set("prettyPrint", "false")
  12011. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  12012. urls += "?" + c.urlParams_.Encode()
  12013. req, err := http.NewRequest("DELETE", urls, body)
  12014. if err != nil {
  12015. return nil, err
  12016. }
  12017. req.Header = reqHeaders
  12018. googleapi.Expand(req.URL, map[string]string{
  12019. "enterpriseId": c.enterpriseId,
  12020. "pageId": c.pageId,
  12021. })
  12022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12023. }
  12024. // Do executes the "androidenterprise.storelayoutpages.delete" call.
  12025. func (c *StorelayoutpagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  12026. gensupport.SetOptions(c.urlParams_, opts...)
  12027. res, err := c.doRequest("json")
  12028. if err != nil {
  12029. return err
  12030. }
  12031. defer googleapi.CloseBody(res)
  12032. if err := googleapi.CheckResponse(res); err != nil {
  12033. return err
  12034. }
  12035. return nil
  12036. // {
  12037. // "description": "Deletes a store page.",
  12038. // "httpMethod": "DELETE",
  12039. // "id": "androidenterprise.storelayoutpages.delete",
  12040. // "parameterOrder": [
  12041. // "enterpriseId",
  12042. // "pageId"
  12043. // ],
  12044. // "parameters": {
  12045. // "enterpriseId": {
  12046. // "description": "The ID of the enterprise.",
  12047. // "location": "path",
  12048. // "required": true,
  12049. // "type": "string"
  12050. // },
  12051. // "pageId": {
  12052. // "description": "The ID of the page.",
  12053. // "location": "path",
  12054. // "required": true,
  12055. // "type": "string"
  12056. // }
  12057. // },
  12058. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  12059. // "scopes": [
  12060. // "https://www.googleapis.com/auth/androidenterprise"
  12061. // ]
  12062. // }
  12063. }
  12064. // method id "androidenterprise.storelayoutpages.get":
  12065. type StorelayoutpagesGetCall struct {
  12066. s *Service
  12067. enterpriseId string
  12068. pageId string
  12069. urlParams_ gensupport.URLParams
  12070. ifNoneMatch_ string
  12071. ctx_ context.Context
  12072. header_ http.Header
  12073. }
  12074. // Get: Retrieves details of a store page.
  12075. func (r *StorelayoutpagesService) Get(enterpriseId string, pageId string) *StorelayoutpagesGetCall {
  12076. c := &StorelayoutpagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12077. c.enterpriseId = enterpriseId
  12078. c.pageId = pageId
  12079. return c
  12080. }
  12081. // Fields allows partial responses to be retrieved. See
  12082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12083. // for more information.
  12084. func (c *StorelayoutpagesGetCall) Fields(s ...googleapi.Field) *StorelayoutpagesGetCall {
  12085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12086. return c
  12087. }
  12088. // IfNoneMatch sets the optional parameter which makes the operation
  12089. // fail if the object's ETag matches the given value. This is useful for
  12090. // getting updates only after the object has changed since the last
  12091. // request. Use googleapi.IsNotModified to check whether the response
  12092. // error from Do is the result of In-None-Match.
  12093. func (c *StorelayoutpagesGetCall) IfNoneMatch(entityTag string) *StorelayoutpagesGetCall {
  12094. c.ifNoneMatch_ = entityTag
  12095. return c
  12096. }
  12097. // Context sets the context to be used in this call's Do method. Any
  12098. // pending HTTP request will be aborted if the provided context is
  12099. // canceled.
  12100. func (c *StorelayoutpagesGetCall) Context(ctx context.Context) *StorelayoutpagesGetCall {
  12101. c.ctx_ = ctx
  12102. return c
  12103. }
  12104. // Header returns an http.Header that can be modified by the caller to
  12105. // add HTTP headers to the request.
  12106. func (c *StorelayoutpagesGetCall) Header() http.Header {
  12107. if c.header_ == nil {
  12108. c.header_ = make(http.Header)
  12109. }
  12110. return c.header_
  12111. }
  12112. func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) {
  12113. reqHeaders := make(http.Header)
  12114. for k, v := range c.header_ {
  12115. reqHeaders[k] = v
  12116. }
  12117. reqHeaders.Set("User-Agent", c.s.userAgent())
  12118. if c.ifNoneMatch_ != "" {
  12119. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12120. }
  12121. var body io.Reader = nil
  12122. c.urlParams_.Set("alt", alt)
  12123. c.urlParams_.Set("prettyPrint", "false")
  12124. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  12125. urls += "?" + c.urlParams_.Encode()
  12126. req, err := http.NewRequest("GET", urls, body)
  12127. if err != nil {
  12128. return nil, err
  12129. }
  12130. req.Header = reqHeaders
  12131. googleapi.Expand(req.URL, map[string]string{
  12132. "enterpriseId": c.enterpriseId,
  12133. "pageId": c.pageId,
  12134. })
  12135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12136. }
  12137. // Do executes the "androidenterprise.storelayoutpages.get" call.
  12138. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  12139. // status code is an error. Response headers are in either
  12140. // *StorePage.ServerResponse.Header or (if a response was returned at
  12141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12142. // to check whether the returned error was because
  12143. // http.StatusNotModified was returned.
  12144. func (c *StorelayoutpagesGetCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  12145. gensupport.SetOptions(c.urlParams_, opts...)
  12146. res, err := c.doRequest("json")
  12147. if res != nil && res.StatusCode == http.StatusNotModified {
  12148. if res.Body != nil {
  12149. res.Body.Close()
  12150. }
  12151. return nil, &googleapi.Error{
  12152. Code: res.StatusCode,
  12153. Header: res.Header,
  12154. }
  12155. }
  12156. if err != nil {
  12157. return nil, err
  12158. }
  12159. defer googleapi.CloseBody(res)
  12160. if err := googleapi.CheckResponse(res); err != nil {
  12161. return nil, err
  12162. }
  12163. ret := &StorePage{
  12164. ServerResponse: googleapi.ServerResponse{
  12165. Header: res.Header,
  12166. HTTPStatusCode: res.StatusCode,
  12167. },
  12168. }
  12169. target := &ret
  12170. if err := gensupport.DecodeResponse(target, res); err != nil {
  12171. return nil, err
  12172. }
  12173. return ret, nil
  12174. // {
  12175. // "description": "Retrieves details of a store page.",
  12176. // "httpMethod": "GET",
  12177. // "id": "androidenterprise.storelayoutpages.get",
  12178. // "parameterOrder": [
  12179. // "enterpriseId",
  12180. // "pageId"
  12181. // ],
  12182. // "parameters": {
  12183. // "enterpriseId": {
  12184. // "description": "The ID of the enterprise.",
  12185. // "location": "path",
  12186. // "required": true,
  12187. // "type": "string"
  12188. // },
  12189. // "pageId": {
  12190. // "description": "The ID of the page.",
  12191. // "location": "path",
  12192. // "required": true,
  12193. // "type": "string"
  12194. // }
  12195. // },
  12196. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  12197. // "response": {
  12198. // "$ref": "StorePage"
  12199. // },
  12200. // "scopes": [
  12201. // "https://www.googleapis.com/auth/androidenterprise"
  12202. // ]
  12203. // }
  12204. }
  12205. // method id "androidenterprise.storelayoutpages.insert":
  12206. type StorelayoutpagesInsertCall struct {
  12207. s *Service
  12208. enterpriseId string
  12209. storepage *StorePage
  12210. urlParams_ gensupport.URLParams
  12211. ctx_ context.Context
  12212. header_ http.Header
  12213. }
  12214. // Insert: Inserts a new store page.
  12215. func (r *StorelayoutpagesService) Insert(enterpriseId string, storepage *StorePage) *StorelayoutpagesInsertCall {
  12216. c := &StorelayoutpagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12217. c.enterpriseId = enterpriseId
  12218. c.storepage = storepage
  12219. return c
  12220. }
  12221. // Fields allows partial responses to be retrieved. See
  12222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12223. // for more information.
  12224. func (c *StorelayoutpagesInsertCall) Fields(s ...googleapi.Field) *StorelayoutpagesInsertCall {
  12225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12226. return c
  12227. }
  12228. // Context sets the context to be used in this call's Do method. Any
  12229. // pending HTTP request will be aborted if the provided context is
  12230. // canceled.
  12231. func (c *StorelayoutpagesInsertCall) Context(ctx context.Context) *StorelayoutpagesInsertCall {
  12232. c.ctx_ = ctx
  12233. return c
  12234. }
  12235. // Header returns an http.Header that can be modified by the caller to
  12236. // add HTTP headers to the request.
  12237. func (c *StorelayoutpagesInsertCall) Header() http.Header {
  12238. if c.header_ == nil {
  12239. c.header_ = make(http.Header)
  12240. }
  12241. return c.header_
  12242. }
  12243. func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) {
  12244. reqHeaders := make(http.Header)
  12245. for k, v := range c.header_ {
  12246. reqHeaders[k] = v
  12247. }
  12248. reqHeaders.Set("User-Agent", c.s.userAgent())
  12249. var body io.Reader = nil
  12250. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
  12251. if err != nil {
  12252. return nil, err
  12253. }
  12254. reqHeaders.Set("Content-Type", "application/json")
  12255. c.urlParams_.Set("alt", alt)
  12256. c.urlParams_.Set("prettyPrint", "false")
  12257. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages")
  12258. urls += "?" + c.urlParams_.Encode()
  12259. req, err := http.NewRequest("POST", urls, body)
  12260. if err != nil {
  12261. return nil, err
  12262. }
  12263. req.Header = reqHeaders
  12264. googleapi.Expand(req.URL, map[string]string{
  12265. "enterpriseId": c.enterpriseId,
  12266. })
  12267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12268. }
  12269. // Do executes the "androidenterprise.storelayoutpages.insert" call.
  12270. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  12271. // status code is an error. Response headers are in either
  12272. // *StorePage.ServerResponse.Header or (if a response was returned at
  12273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12274. // to check whether the returned error was because
  12275. // http.StatusNotModified was returned.
  12276. func (c *StorelayoutpagesInsertCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  12277. gensupport.SetOptions(c.urlParams_, opts...)
  12278. res, err := c.doRequest("json")
  12279. if res != nil && res.StatusCode == http.StatusNotModified {
  12280. if res.Body != nil {
  12281. res.Body.Close()
  12282. }
  12283. return nil, &googleapi.Error{
  12284. Code: res.StatusCode,
  12285. Header: res.Header,
  12286. }
  12287. }
  12288. if err != nil {
  12289. return nil, err
  12290. }
  12291. defer googleapi.CloseBody(res)
  12292. if err := googleapi.CheckResponse(res); err != nil {
  12293. return nil, err
  12294. }
  12295. ret := &StorePage{
  12296. ServerResponse: googleapi.ServerResponse{
  12297. Header: res.Header,
  12298. HTTPStatusCode: res.StatusCode,
  12299. },
  12300. }
  12301. target := &ret
  12302. if err := gensupport.DecodeResponse(target, res); err != nil {
  12303. return nil, err
  12304. }
  12305. return ret, nil
  12306. // {
  12307. // "description": "Inserts a new store page.",
  12308. // "httpMethod": "POST",
  12309. // "id": "androidenterprise.storelayoutpages.insert",
  12310. // "parameterOrder": [
  12311. // "enterpriseId"
  12312. // ],
  12313. // "parameters": {
  12314. // "enterpriseId": {
  12315. // "description": "The ID of the enterprise.",
  12316. // "location": "path",
  12317. // "required": true,
  12318. // "type": "string"
  12319. // }
  12320. // },
  12321. // "path": "enterprises/{enterpriseId}/storeLayout/pages",
  12322. // "request": {
  12323. // "$ref": "StorePage"
  12324. // },
  12325. // "response": {
  12326. // "$ref": "StorePage"
  12327. // },
  12328. // "scopes": [
  12329. // "https://www.googleapis.com/auth/androidenterprise"
  12330. // ]
  12331. // }
  12332. }
  12333. // method id "androidenterprise.storelayoutpages.list":
  12334. type StorelayoutpagesListCall struct {
  12335. s *Service
  12336. enterpriseId string
  12337. urlParams_ gensupport.URLParams
  12338. ifNoneMatch_ string
  12339. ctx_ context.Context
  12340. header_ http.Header
  12341. }
  12342. // List: Retrieves the details of all pages in the store.
  12343. func (r *StorelayoutpagesService) List(enterpriseId string) *StorelayoutpagesListCall {
  12344. c := &StorelayoutpagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12345. c.enterpriseId = enterpriseId
  12346. return c
  12347. }
  12348. // Fields allows partial responses to be retrieved. See
  12349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12350. // for more information.
  12351. func (c *StorelayoutpagesListCall) Fields(s ...googleapi.Field) *StorelayoutpagesListCall {
  12352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12353. return c
  12354. }
  12355. // IfNoneMatch sets the optional parameter which makes the operation
  12356. // fail if the object's ETag matches the given value. This is useful for
  12357. // getting updates only after the object has changed since the last
  12358. // request. Use googleapi.IsNotModified to check whether the response
  12359. // error from Do is the result of In-None-Match.
  12360. func (c *StorelayoutpagesListCall) IfNoneMatch(entityTag string) *StorelayoutpagesListCall {
  12361. c.ifNoneMatch_ = entityTag
  12362. return c
  12363. }
  12364. // Context sets the context to be used in this call's Do method. Any
  12365. // pending HTTP request will be aborted if the provided context is
  12366. // canceled.
  12367. func (c *StorelayoutpagesListCall) Context(ctx context.Context) *StorelayoutpagesListCall {
  12368. c.ctx_ = ctx
  12369. return c
  12370. }
  12371. // Header returns an http.Header that can be modified by the caller to
  12372. // add HTTP headers to the request.
  12373. func (c *StorelayoutpagesListCall) Header() http.Header {
  12374. if c.header_ == nil {
  12375. c.header_ = make(http.Header)
  12376. }
  12377. return c.header_
  12378. }
  12379. func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) {
  12380. reqHeaders := make(http.Header)
  12381. for k, v := range c.header_ {
  12382. reqHeaders[k] = v
  12383. }
  12384. reqHeaders.Set("User-Agent", c.s.userAgent())
  12385. if c.ifNoneMatch_ != "" {
  12386. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12387. }
  12388. var body io.Reader = nil
  12389. c.urlParams_.Set("alt", alt)
  12390. c.urlParams_.Set("prettyPrint", "false")
  12391. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages")
  12392. urls += "?" + c.urlParams_.Encode()
  12393. req, err := http.NewRequest("GET", urls, body)
  12394. if err != nil {
  12395. return nil, err
  12396. }
  12397. req.Header = reqHeaders
  12398. googleapi.Expand(req.URL, map[string]string{
  12399. "enterpriseId": c.enterpriseId,
  12400. })
  12401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12402. }
  12403. // Do executes the "androidenterprise.storelayoutpages.list" call.
  12404. // Exactly one of *StoreLayoutPagesListResponse or error will be
  12405. // non-nil. Any non-2xx status code is an error. Response headers are in
  12406. // either *StoreLayoutPagesListResponse.ServerResponse.Header or (if a
  12407. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12408. // googleapi.IsNotModified to check whether the returned error was
  12409. // because http.StatusNotModified was returned.
  12410. func (c *StorelayoutpagesListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutPagesListResponse, error) {
  12411. gensupport.SetOptions(c.urlParams_, opts...)
  12412. res, err := c.doRequest("json")
  12413. if res != nil && res.StatusCode == http.StatusNotModified {
  12414. if res.Body != nil {
  12415. res.Body.Close()
  12416. }
  12417. return nil, &googleapi.Error{
  12418. Code: res.StatusCode,
  12419. Header: res.Header,
  12420. }
  12421. }
  12422. if err != nil {
  12423. return nil, err
  12424. }
  12425. defer googleapi.CloseBody(res)
  12426. if err := googleapi.CheckResponse(res); err != nil {
  12427. return nil, err
  12428. }
  12429. ret := &StoreLayoutPagesListResponse{
  12430. ServerResponse: googleapi.ServerResponse{
  12431. Header: res.Header,
  12432. HTTPStatusCode: res.StatusCode,
  12433. },
  12434. }
  12435. target := &ret
  12436. if err := gensupport.DecodeResponse(target, res); err != nil {
  12437. return nil, err
  12438. }
  12439. return ret, nil
  12440. // {
  12441. // "description": "Retrieves the details of all pages in the store.",
  12442. // "httpMethod": "GET",
  12443. // "id": "androidenterprise.storelayoutpages.list",
  12444. // "parameterOrder": [
  12445. // "enterpriseId"
  12446. // ],
  12447. // "parameters": {
  12448. // "enterpriseId": {
  12449. // "description": "The ID of the enterprise.",
  12450. // "location": "path",
  12451. // "required": true,
  12452. // "type": "string"
  12453. // }
  12454. // },
  12455. // "path": "enterprises/{enterpriseId}/storeLayout/pages",
  12456. // "response": {
  12457. // "$ref": "StoreLayoutPagesListResponse"
  12458. // },
  12459. // "scopes": [
  12460. // "https://www.googleapis.com/auth/androidenterprise"
  12461. // ]
  12462. // }
  12463. }
  12464. // method id "androidenterprise.storelayoutpages.patch":
  12465. type StorelayoutpagesPatchCall struct {
  12466. s *Service
  12467. enterpriseId string
  12468. pageId string
  12469. storepage *StorePage
  12470. urlParams_ gensupport.URLParams
  12471. ctx_ context.Context
  12472. header_ http.Header
  12473. }
  12474. // Patch: Updates the content of a store page. This method supports
  12475. // patch semantics.
  12476. func (r *StorelayoutpagesService) Patch(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesPatchCall {
  12477. c := &StorelayoutpagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12478. c.enterpriseId = enterpriseId
  12479. c.pageId = pageId
  12480. c.storepage = storepage
  12481. return c
  12482. }
  12483. // Fields allows partial responses to be retrieved. See
  12484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12485. // for more information.
  12486. func (c *StorelayoutpagesPatchCall) Fields(s ...googleapi.Field) *StorelayoutpagesPatchCall {
  12487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12488. return c
  12489. }
  12490. // Context sets the context to be used in this call's Do method. Any
  12491. // pending HTTP request will be aborted if the provided context is
  12492. // canceled.
  12493. func (c *StorelayoutpagesPatchCall) Context(ctx context.Context) *StorelayoutpagesPatchCall {
  12494. c.ctx_ = ctx
  12495. return c
  12496. }
  12497. // Header returns an http.Header that can be modified by the caller to
  12498. // add HTTP headers to the request.
  12499. func (c *StorelayoutpagesPatchCall) Header() http.Header {
  12500. if c.header_ == nil {
  12501. c.header_ = make(http.Header)
  12502. }
  12503. return c.header_
  12504. }
  12505. func (c *StorelayoutpagesPatchCall) doRequest(alt string) (*http.Response, error) {
  12506. reqHeaders := make(http.Header)
  12507. for k, v := range c.header_ {
  12508. reqHeaders[k] = v
  12509. }
  12510. reqHeaders.Set("User-Agent", c.s.userAgent())
  12511. var body io.Reader = nil
  12512. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
  12513. if err != nil {
  12514. return nil, err
  12515. }
  12516. reqHeaders.Set("Content-Type", "application/json")
  12517. c.urlParams_.Set("alt", alt)
  12518. c.urlParams_.Set("prettyPrint", "false")
  12519. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  12520. urls += "?" + c.urlParams_.Encode()
  12521. req, err := http.NewRequest("PATCH", urls, body)
  12522. if err != nil {
  12523. return nil, err
  12524. }
  12525. req.Header = reqHeaders
  12526. googleapi.Expand(req.URL, map[string]string{
  12527. "enterpriseId": c.enterpriseId,
  12528. "pageId": c.pageId,
  12529. })
  12530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12531. }
  12532. // Do executes the "androidenterprise.storelayoutpages.patch" call.
  12533. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  12534. // status code is an error. Response headers are in either
  12535. // *StorePage.ServerResponse.Header or (if a response was returned at
  12536. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12537. // to check whether the returned error was because
  12538. // http.StatusNotModified was returned.
  12539. func (c *StorelayoutpagesPatchCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  12540. gensupport.SetOptions(c.urlParams_, opts...)
  12541. res, err := c.doRequest("json")
  12542. if res != nil && res.StatusCode == http.StatusNotModified {
  12543. if res.Body != nil {
  12544. res.Body.Close()
  12545. }
  12546. return nil, &googleapi.Error{
  12547. Code: res.StatusCode,
  12548. Header: res.Header,
  12549. }
  12550. }
  12551. if err != nil {
  12552. return nil, err
  12553. }
  12554. defer googleapi.CloseBody(res)
  12555. if err := googleapi.CheckResponse(res); err != nil {
  12556. return nil, err
  12557. }
  12558. ret := &StorePage{
  12559. ServerResponse: googleapi.ServerResponse{
  12560. Header: res.Header,
  12561. HTTPStatusCode: res.StatusCode,
  12562. },
  12563. }
  12564. target := &ret
  12565. if err := gensupport.DecodeResponse(target, res); err != nil {
  12566. return nil, err
  12567. }
  12568. return ret, nil
  12569. // {
  12570. // "description": "Updates the content of a store page. This method supports patch semantics.",
  12571. // "httpMethod": "PATCH",
  12572. // "id": "androidenterprise.storelayoutpages.patch",
  12573. // "parameterOrder": [
  12574. // "enterpriseId",
  12575. // "pageId"
  12576. // ],
  12577. // "parameters": {
  12578. // "enterpriseId": {
  12579. // "description": "The ID of the enterprise.",
  12580. // "location": "path",
  12581. // "required": true,
  12582. // "type": "string"
  12583. // },
  12584. // "pageId": {
  12585. // "description": "The ID of the page.",
  12586. // "location": "path",
  12587. // "required": true,
  12588. // "type": "string"
  12589. // }
  12590. // },
  12591. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  12592. // "request": {
  12593. // "$ref": "StorePage"
  12594. // },
  12595. // "response": {
  12596. // "$ref": "StorePage"
  12597. // },
  12598. // "scopes": [
  12599. // "https://www.googleapis.com/auth/androidenterprise"
  12600. // ]
  12601. // }
  12602. }
  12603. // method id "androidenterprise.storelayoutpages.update":
  12604. type StorelayoutpagesUpdateCall struct {
  12605. s *Service
  12606. enterpriseId string
  12607. pageId string
  12608. storepage *StorePage
  12609. urlParams_ gensupport.URLParams
  12610. ctx_ context.Context
  12611. header_ http.Header
  12612. }
  12613. // Update: Updates the content of a store page.
  12614. func (r *StorelayoutpagesService) Update(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesUpdateCall {
  12615. c := &StorelayoutpagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12616. c.enterpriseId = enterpriseId
  12617. c.pageId = pageId
  12618. c.storepage = storepage
  12619. return c
  12620. }
  12621. // Fields allows partial responses to be retrieved. See
  12622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12623. // for more information.
  12624. func (c *StorelayoutpagesUpdateCall) Fields(s ...googleapi.Field) *StorelayoutpagesUpdateCall {
  12625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12626. return c
  12627. }
  12628. // Context sets the context to be used in this call's Do method. Any
  12629. // pending HTTP request will be aborted if the provided context is
  12630. // canceled.
  12631. func (c *StorelayoutpagesUpdateCall) Context(ctx context.Context) *StorelayoutpagesUpdateCall {
  12632. c.ctx_ = ctx
  12633. return c
  12634. }
  12635. // Header returns an http.Header that can be modified by the caller to
  12636. // add HTTP headers to the request.
  12637. func (c *StorelayoutpagesUpdateCall) Header() http.Header {
  12638. if c.header_ == nil {
  12639. c.header_ = make(http.Header)
  12640. }
  12641. return c.header_
  12642. }
  12643. func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12644. reqHeaders := make(http.Header)
  12645. for k, v := range c.header_ {
  12646. reqHeaders[k] = v
  12647. }
  12648. reqHeaders.Set("User-Agent", c.s.userAgent())
  12649. var body io.Reader = nil
  12650. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
  12651. if err != nil {
  12652. return nil, err
  12653. }
  12654. reqHeaders.Set("Content-Type", "application/json")
  12655. c.urlParams_.Set("alt", alt)
  12656. c.urlParams_.Set("prettyPrint", "false")
  12657. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  12658. urls += "?" + c.urlParams_.Encode()
  12659. req, err := http.NewRequest("PUT", urls, body)
  12660. if err != nil {
  12661. return nil, err
  12662. }
  12663. req.Header = reqHeaders
  12664. googleapi.Expand(req.URL, map[string]string{
  12665. "enterpriseId": c.enterpriseId,
  12666. "pageId": c.pageId,
  12667. })
  12668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12669. }
  12670. // Do executes the "androidenterprise.storelayoutpages.update" call.
  12671. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  12672. // status code is an error. Response headers are in either
  12673. // *StorePage.ServerResponse.Header or (if a response was returned at
  12674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12675. // to check whether the returned error was because
  12676. // http.StatusNotModified was returned.
  12677. func (c *StorelayoutpagesUpdateCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  12678. gensupport.SetOptions(c.urlParams_, opts...)
  12679. res, err := c.doRequest("json")
  12680. if res != nil && res.StatusCode == http.StatusNotModified {
  12681. if res.Body != nil {
  12682. res.Body.Close()
  12683. }
  12684. return nil, &googleapi.Error{
  12685. Code: res.StatusCode,
  12686. Header: res.Header,
  12687. }
  12688. }
  12689. if err != nil {
  12690. return nil, err
  12691. }
  12692. defer googleapi.CloseBody(res)
  12693. if err := googleapi.CheckResponse(res); err != nil {
  12694. return nil, err
  12695. }
  12696. ret := &StorePage{
  12697. ServerResponse: googleapi.ServerResponse{
  12698. Header: res.Header,
  12699. HTTPStatusCode: res.StatusCode,
  12700. },
  12701. }
  12702. target := &ret
  12703. if err := gensupport.DecodeResponse(target, res); err != nil {
  12704. return nil, err
  12705. }
  12706. return ret, nil
  12707. // {
  12708. // "description": "Updates the content of a store page.",
  12709. // "httpMethod": "PUT",
  12710. // "id": "androidenterprise.storelayoutpages.update",
  12711. // "parameterOrder": [
  12712. // "enterpriseId",
  12713. // "pageId"
  12714. // ],
  12715. // "parameters": {
  12716. // "enterpriseId": {
  12717. // "description": "The ID of the enterprise.",
  12718. // "location": "path",
  12719. // "required": true,
  12720. // "type": "string"
  12721. // },
  12722. // "pageId": {
  12723. // "description": "The ID of the page.",
  12724. // "location": "path",
  12725. // "required": true,
  12726. // "type": "string"
  12727. // }
  12728. // },
  12729. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  12730. // "request": {
  12731. // "$ref": "StorePage"
  12732. // },
  12733. // "response": {
  12734. // "$ref": "StorePage"
  12735. // },
  12736. // "scopes": [
  12737. // "https://www.googleapis.com/auth/androidenterprise"
  12738. // ]
  12739. // }
  12740. }
  12741. // method id "androidenterprise.users.delete":
  12742. type UsersDeleteCall struct {
  12743. s *Service
  12744. enterpriseId string
  12745. userId string
  12746. urlParams_ gensupport.URLParams
  12747. ctx_ context.Context
  12748. header_ http.Header
  12749. }
  12750. // Delete: Deleted an EMM-managed user.
  12751. func (r *UsersService) Delete(enterpriseId string, userId string) *UsersDeleteCall {
  12752. c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12753. c.enterpriseId = enterpriseId
  12754. c.userId = userId
  12755. return c
  12756. }
  12757. // Fields allows partial responses to be retrieved. See
  12758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12759. // for more information.
  12760. func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
  12761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12762. return c
  12763. }
  12764. // Context sets the context to be used in this call's Do method. Any
  12765. // pending HTTP request will be aborted if the provided context is
  12766. // canceled.
  12767. func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
  12768. c.ctx_ = ctx
  12769. return c
  12770. }
  12771. // Header returns an http.Header that can be modified by the caller to
  12772. // add HTTP headers to the request.
  12773. func (c *UsersDeleteCall) Header() http.Header {
  12774. if c.header_ == nil {
  12775. c.header_ = make(http.Header)
  12776. }
  12777. return c.header_
  12778. }
  12779. func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
  12780. reqHeaders := make(http.Header)
  12781. for k, v := range c.header_ {
  12782. reqHeaders[k] = v
  12783. }
  12784. reqHeaders.Set("User-Agent", c.s.userAgent())
  12785. var body io.Reader = nil
  12786. c.urlParams_.Set("alt", alt)
  12787. c.urlParams_.Set("prettyPrint", "false")
  12788. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  12789. urls += "?" + c.urlParams_.Encode()
  12790. req, err := http.NewRequest("DELETE", urls, body)
  12791. if err != nil {
  12792. return nil, err
  12793. }
  12794. req.Header = reqHeaders
  12795. googleapi.Expand(req.URL, map[string]string{
  12796. "enterpriseId": c.enterpriseId,
  12797. "userId": c.userId,
  12798. })
  12799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12800. }
  12801. // Do executes the "androidenterprise.users.delete" call.
  12802. func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error {
  12803. gensupport.SetOptions(c.urlParams_, opts...)
  12804. res, err := c.doRequest("json")
  12805. if err != nil {
  12806. return err
  12807. }
  12808. defer googleapi.CloseBody(res)
  12809. if err := googleapi.CheckResponse(res); err != nil {
  12810. return err
  12811. }
  12812. return nil
  12813. // {
  12814. // "description": "Deleted an EMM-managed user.",
  12815. // "httpMethod": "DELETE",
  12816. // "id": "androidenterprise.users.delete",
  12817. // "parameterOrder": [
  12818. // "enterpriseId",
  12819. // "userId"
  12820. // ],
  12821. // "parameters": {
  12822. // "enterpriseId": {
  12823. // "description": "The ID of the enterprise.",
  12824. // "location": "path",
  12825. // "required": true,
  12826. // "type": "string"
  12827. // },
  12828. // "userId": {
  12829. // "description": "The ID of the user.",
  12830. // "location": "path",
  12831. // "required": true,
  12832. // "type": "string"
  12833. // }
  12834. // },
  12835. // "path": "enterprises/{enterpriseId}/users/{userId}",
  12836. // "scopes": [
  12837. // "https://www.googleapis.com/auth/androidenterprise"
  12838. // ]
  12839. // }
  12840. }
  12841. // method id "androidenterprise.users.generateAuthenticationToken":
  12842. type UsersGenerateAuthenticationTokenCall struct {
  12843. s *Service
  12844. enterpriseId string
  12845. userId string
  12846. urlParams_ gensupport.URLParams
  12847. ctx_ context.Context
  12848. header_ http.Header
  12849. }
  12850. // GenerateAuthenticationToken: Generates an authentication token which
  12851. // the device policy client can use to provision the given EMM-managed
  12852. // user account on a device. The generated token is single-use and
  12853. // expires after a few minutes.
  12854. //
  12855. // You can provision a maximum of 10 devices per user.
  12856. //
  12857. // This call only works with EMM-managed accounts.
  12858. func (r *UsersService) GenerateAuthenticationToken(enterpriseId string, userId string) *UsersGenerateAuthenticationTokenCall {
  12859. c := &UsersGenerateAuthenticationTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12860. c.enterpriseId = enterpriseId
  12861. c.userId = userId
  12862. return c
  12863. }
  12864. // Fields allows partial responses to be retrieved. See
  12865. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12866. // for more information.
  12867. func (c *UsersGenerateAuthenticationTokenCall) Fields(s ...googleapi.Field) *UsersGenerateAuthenticationTokenCall {
  12868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12869. return c
  12870. }
  12871. // Context sets the context to be used in this call's Do method. Any
  12872. // pending HTTP request will be aborted if the provided context is
  12873. // canceled.
  12874. func (c *UsersGenerateAuthenticationTokenCall) Context(ctx context.Context) *UsersGenerateAuthenticationTokenCall {
  12875. c.ctx_ = ctx
  12876. return c
  12877. }
  12878. // Header returns an http.Header that can be modified by the caller to
  12879. // add HTTP headers to the request.
  12880. func (c *UsersGenerateAuthenticationTokenCall) Header() http.Header {
  12881. if c.header_ == nil {
  12882. c.header_ = make(http.Header)
  12883. }
  12884. return c.header_
  12885. }
  12886. func (c *UsersGenerateAuthenticationTokenCall) doRequest(alt string) (*http.Response, error) {
  12887. reqHeaders := make(http.Header)
  12888. for k, v := range c.header_ {
  12889. reqHeaders[k] = v
  12890. }
  12891. reqHeaders.Set("User-Agent", c.s.userAgent())
  12892. var body io.Reader = nil
  12893. c.urlParams_.Set("alt", alt)
  12894. c.urlParams_.Set("prettyPrint", "false")
  12895. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/authenticationToken")
  12896. urls += "?" + c.urlParams_.Encode()
  12897. req, err := http.NewRequest("POST", urls, body)
  12898. if err != nil {
  12899. return nil, err
  12900. }
  12901. req.Header = reqHeaders
  12902. googleapi.Expand(req.URL, map[string]string{
  12903. "enterpriseId": c.enterpriseId,
  12904. "userId": c.userId,
  12905. })
  12906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12907. }
  12908. // Do executes the "androidenterprise.users.generateAuthenticationToken" call.
  12909. // Exactly one of *AuthenticationToken or error will be non-nil. Any
  12910. // non-2xx status code is an error. Response headers are in either
  12911. // *AuthenticationToken.ServerResponse.Header or (if a response was
  12912. // returned at all) in error.(*googleapi.Error).Header. Use
  12913. // googleapi.IsNotModified to check whether the returned error was
  12914. // because http.StatusNotModified was returned.
  12915. func (c *UsersGenerateAuthenticationTokenCall) Do(opts ...googleapi.CallOption) (*AuthenticationToken, error) {
  12916. gensupport.SetOptions(c.urlParams_, opts...)
  12917. res, err := c.doRequest("json")
  12918. if res != nil && res.StatusCode == http.StatusNotModified {
  12919. if res.Body != nil {
  12920. res.Body.Close()
  12921. }
  12922. return nil, &googleapi.Error{
  12923. Code: res.StatusCode,
  12924. Header: res.Header,
  12925. }
  12926. }
  12927. if err != nil {
  12928. return nil, err
  12929. }
  12930. defer googleapi.CloseBody(res)
  12931. if err := googleapi.CheckResponse(res); err != nil {
  12932. return nil, err
  12933. }
  12934. ret := &AuthenticationToken{
  12935. ServerResponse: googleapi.ServerResponse{
  12936. Header: res.Header,
  12937. HTTPStatusCode: res.StatusCode,
  12938. },
  12939. }
  12940. target := &ret
  12941. if err := gensupport.DecodeResponse(target, res); err != nil {
  12942. return nil, err
  12943. }
  12944. return ret, nil
  12945. // {
  12946. // "description": "Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes.\n\nYou can provision a maximum of 10 devices per user.\n\nThis call only works with EMM-managed accounts.",
  12947. // "httpMethod": "POST",
  12948. // "id": "androidenterprise.users.generateAuthenticationToken",
  12949. // "parameterOrder": [
  12950. // "enterpriseId",
  12951. // "userId"
  12952. // ],
  12953. // "parameters": {
  12954. // "enterpriseId": {
  12955. // "description": "The ID of the enterprise.",
  12956. // "location": "path",
  12957. // "required": true,
  12958. // "type": "string"
  12959. // },
  12960. // "userId": {
  12961. // "description": "The ID of the user.",
  12962. // "location": "path",
  12963. // "required": true,
  12964. // "type": "string"
  12965. // }
  12966. // },
  12967. // "path": "enterprises/{enterpriseId}/users/{userId}/authenticationToken",
  12968. // "response": {
  12969. // "$ref": "AuthenticationToken"
  12970. // },
  12971. // "scopes": [
  12972. // "https://www.googleapis.com/auth/androidenterprise"
  12973. // ]
  12974. // }
  12975. }
  12976. // method id "androidenterprise.users.generateToken":
  12977. type UsersGenerateTokenCall struct {
  12978. s *Service
  12979. enterpriseId string
  12980. userId string
  12981. urlParams_ gensupport.URLParams
  12982. ctx_ context.Context
  12983. header_ http.Header
  12984. }
  12985. // GenerateToken: Generates a token (activation code) to allow this user
  12986. // to configure their managed account in the Android Setup Wizard.
  12987. // Revokes any previously generated token.
  12988. //
  12989. // This call only works with Google managed accounts.
  12990. func (r *UsersService) GenerateToken(enterpriseId string, userId string) *UsersGenerateTokenCall {
  12991. c := &UsersGenerateTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12992. c.enterpriseId = enterpriseId
  12993. c.userId = userId
  12994. return c
  12995. }
  12996. // Fields allows partial responses to be retrieved. See
  12997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12998. // for more information.
  12999. func (c *UsersGenerateTokenCall) Fields(s ...googleapi.Field) *UsersGenerateTokenCall {
  13000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13001. return c
  13002. }
  13003. // Context sets the context to be used in this call's Do method. Any
  13004. // pending HTTP request will be aborted if the provided context is
  13005. // canceled.
  13006. func (c *UsersGenerateTokenCall) Context(ctx context.Context) *UsersGenerateTokenCall {
  13007. c.ctx_ = ctx
  13008. return c
  13009. }
  13010. // Header returns an http.Header that can be modified by the caller to
  13011. // add HTTP headers to the request.
  13012. func (c *UsersGenerateTokenCall) Header() http.Header {
  13013. if c.header_ == nil {
  13014. c.header_ = make(http.Header)
  13015. }
  13016. return c.header_
  13017. }
  13018. func (c *UsersGenerateTokenCall) doRequest(alt string) (*http.Response, error) {
  13019. reqHeaders := make(http.Header)
  13020. for k, v := range c.header_ {
  13021. reqHeaders[k] = v
  13022. }
  13023. reqHeaders.Set("User-Agent", c.s.userAgent())
  13024. var body io.Reader = nil
  13025. c.urlParams_.Set("alt", alt)
  13026. c.urlParams_.Set("prettyPrint", "false")
  13027. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
  13028. urls += "?" + c.urlParams_.Encode()
  13029. req, err := http.NewRequest("POST", urls, body)
  13030. if err != nil {
  13031. return nil, err
  13032. }
  13033. req.Header = reqHeaders
  13034. googleapi.Expand(req.URL, map[string]string{
  13035. "enterpriseId": c.enterpriseId,
  13036. "userId": c.userId,
  13037. })
  13038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13039. }
  13040. // Do executes the "androidenterprise.users.generateToken" call.
  13041. // Exactly one of *UserToken or error will be non-nil. Any non-2xx
  13042. // status code is an error. Response headers are in either
  13043. // *UserToken.ServerResponse.Header or (if a response was returned at
  13044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13045. // to check whether the returned error was because
  13046. // http.StatusNotModified was returned.
  13047. func (c *UsersGenerateTokenCall) Do(opts ...googleapi.CallOption) (*UserToken, error) {
  13048. gensupport.SetOptions(c.urlParams_, opts...)
  13049. res, err := c.doRequest("json")
  13050. if res != nil && res.StatusCode == http.StatusNotModified {
  13051. if res.Body != nil {
  13052. res.Body.Close()
  13053. }
  13054. return nil, &googleapi.Error{
  13055. Code: res.StatusCode,
  13056. Header: res.Header,
  13057. }
  13058. }
  13059. if err != nil {
  13060. return nil, err
  13061. }
  13062. defer googleapi.CloseBody(res)
  13063. if err := googleapi.CheckResponse(res); err != nil {
  13064. return nil, err
  13065. }
  13066. ret := &UserToken{
  13067. ServerResponse: googleapi.ServerResponse{
  13068. Header: res.Header,
  13069. HTTPStatusCode: res.StatusCode,
  13070. },
  13071. }
  13072. target := &ret
  13073. if err := gensupport.DecodeResponse(target, res); err != nil {
  13074. return nil, err
  13075. }
  13076. return ret, nil
  13077. // {
  13078. // "description": "Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token.\n\nThis call only works with Google managed accounts.",
  13079. // "httpMethod": "POST",
  13080. // "id": "androidenterprise.users.generateToken",
  13081. // "parameterOrder": [
  13082. // "enterpriseId",
  13083. // "userId"
  13084. // ],
  13085. // "parameters": {
  13086. // "enterpriseId": {
  13087. // "description": "The ID of the enterprise.",
  13088. // "location": "path",
  13089. // "required": true,
  13090. // "type": "string"
  13091. // },
  13092. // "userId": {
  13093. // "description": "The ID of the user.",
  13094. // "location": "path",
  13095. // "required": true,
  13096. // "type": "string"
  13097. // }
  13098. // },
  13099. // "path": "enterprises/{enterpriseId}/users/{userId}/token",
  13100. // "response": {
  13101. // "$ref": "UserToken"
  13102. // },
  13103. // "scopes": [
  13104. // "https://www.googleapis.com/auth/androidenterprise"
  13105. // ]
  13106. // }
  13107. }
  13108. // method id "androidenterprise.users.get":
  13109. type UsersGetCall struct {
  13110. s *Service
  13111. enterpriseId string
  13112. userId string
  13113. urlParams_ gensupport.URLParams
  13114. ifNoneMatch_ string
  13115. ctx_ context.Context
  13116. header_ http.Header
  13117. }
  13118. // Get: Retrieves a user's details.
  13119. func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall {
  13120. c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13121. c.enterpriseId = enterpriseId
  13122. c.userId = userId
  13123. return c
  13124. }
  13125. // Fields allows partial responses to be retrieved. See
  13126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13127. // for more information.
  13128. func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
  13129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13130. return c
  13131. }
  13132. // IfNoneMatch sets the optional parameter which makes the operation
  13133. // fail if the object's ETag matches the given value. This is useful for
  13134. // getting updates only after the object has changed since the last
  13135. // request. Use googleapi.IsNotModified to check whether the response
  13136. // error from Do is the result of In-None-Match.
  13137. func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
  13138. c.ifNoneMatch_ = entityTag
  13139. return c
  13140. }
  13141. // Context sets the context to be used in this call's Do method. Any
  13142. // pending HTTP request will be aborted if the provided context is
  13143. // canceled.
  13144. func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
  13145. c.ctx_ = ctx
  13146. return c
  13147. }
  13148. // Header returns an http.Header that can be modified by the caller to
  13149. // add HTTP headers to the request.
  13150. func (c *UsersGetCall) Header() http.Header {
  13151. if c.header_ == nil {
  13152. c.header_ = make(http.Header)
  13153. }
  13154. return c.header_
  13155. }
  13156. func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
  13157. reqHeaders := make(http.Header)
  13158. for k, v := range c.header_ {
  13159. reqHeaders[k] = v
  13160. }
  13161. reqHeaders.Set("User-Agent", c.s.userAgent())
  13162. if c.ifNoneMatch_ != "" {
  13163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13164. }
  13165. var body io.Reader = nil
  13166. c.urlParams_.Set("alt", alt)
  13167. c.urlParams_.Set("prettyPrint", "false")
  13168. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  13169. urls += "?" + c.urlParams_.Encode()
  13170. req, err := http.NewRequest("GET", urls, body)
  13171. if err != nil {
  13172. return nil, err
  13173. }
  13174. req.Header = reqHeaders
  13175. googleapi.Expand(req.URL, map[string]string{
  13176. "enterpriseId": c.enterpriseId,
  13177. "userId": c.userId,
  13178. })
  13179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13180. }
  13181. // Do executes the "androidenterprise.users.get" call.
  13182. // Exactly one of *User or error will be non-nil. Any non-2xx status
  13183. // code is an error. Response headers are in either
  13184. // *User.ServerResponse.Header or (if a response was returned at all) in
  13185. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13186. // whether the returned error was because http.StatusNotModified was
  13187. // returned.
  13188. func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
  13189. gensupport.SetOptions(c.urlParams_, opts...)
  13190. res, err := c.doRequest("json")
  13191. if res != nil && res.StatusCode == http.StatusNotModified {
  13192. if res.Body != nil {
  13193. res.Body.Close()
  13194. }
  13195. return nil, &googleapi.Error{
  13196. Code: res.StatusCode,
  13197. Header: res.Header,
  13198. }
  13199. }
  13200. if err != nil {
  13201. return nil, err
  13202. }
  13203. defer googleapi.CloseBody(res)
  13204. if err := googleapi.CheckResponse(res); err != nil {
  13205. return nil, err
  13206. }
  13207. ret := &User{
  13208. ServerResponse: googleapi.ServerResponse{
  13209. Header: res.Header,
  13210. HTTPStatusCode: res.StatusCode,
  13211. },
  13212. }
  13213. target := &ret
  13214. if err := gensupport.DecodeResponse(target, res); err != nil {
  13215. return nil, err
  13216. }
  13217. return ret, nil
  13218. // {
  13219. // "description": "Retrieves a user's details.",
  13220. // "httpMethod": "GET",
  13221. // "id": "androidenterprise.users.get",
  13222. // "parameterOrder": [
  13223. // "enterpriseId",
  13224. // "userId"
  13225. // ],
  13226. // "parameters": {
  13227. // "enterpriseId": {
  13228. // "description": "The ID of the enterprise.",
  13229. // "location": "path",
  13230. // "required": true,
  13231. // "type": "string"
  13232. // },
  13233. // "userId": {
  13234. // "description": "The ID of the user.",
  13235. // "location": "path",
  13236. // "required": true,
  13237. // "type": "string"
  13238. // }
  13239. // },
  13240. // "path": "enterprises/{enterpriseId}/users/{userId}",
  13241. // "response": {
  13242. // "$ref": "User"
  13243. // },
  13244. // "scopes": [
  13245. // "https://www.googleapis.com/auth/androidenterprise"
  13246. // ]
  13247. // }
  13248. }
  13249. // method id "androidenterprise.users.getAvailableProductSet":
  13250. type UsersGetAvailableProductSetCall struct {
  13251. s *Service
  13252. enterpriseId string
  13253. userId string
  13254. urlParams_ gensupport.URLParams
  13255. ifNoneMatch_ string
  13256. ctx_ context.Context
  13257. header_ http.Header
  13258. }
  13259. // GetAvailableProductSet: Retrieves the set of products a user is
  13260. // entitled to access.
  13261. func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall {
  13262. c := &UsersGetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13263. c.enterpriseId = enterpriseId
  13264. c.userId = userId
  13265. return c
  13266. }
  13267. // Fields allows partial responses to be retrieved. See
  13268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13269. // for more information.
  13270. func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall {
  13271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13272. return c
  13273. }
  13274. // IfNoneMatch sets the optional parameter which makes the operation
  13275. // fail if the object's ETag matches the given value. This is useful for
  13276. // getting updates only after the object has changed since the last
  13277. // request. Use googleapi.IsNotModified to check whether the response
  13278. // error from Do is the result of In-None-Match.
  13279. func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall {
  13280. c.ifNoneMatch_ = entityTag
  13281. return c
  13282. }
  13283. // Context sets the context to be used in this call's Do method. Any
  13284. // pending HTTP request will be aborted if the provided context is
  13285. // canceled.
  13286. func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall {
  13287. c.ctx_ = ctx
  13288. return c
  13289. }
  13290. // Header returns an http.Header that can be modified by the caller to
  13291. // add HTTP headers to the request.
  13292. func (c *UsersGetAvailableProductSetCall) Header() http.Header {
  13293. if c.header_ == nil {
  13294. c.header_ = make(http.Header)
  13295. }
  13296. return c.header_
  13297. }
  13298. func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
  13299. reqHeaders := make(http.Header)
  13300. for k, v := range c.header_ {
  13301. reqHeaders[k] = v
  13302. }
  13303. reqHeaders.Set("User-Agent", c.s.userAgent())
  13304. if c.ifNoneMatch_ != "" {
  13305. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13306. }
  13307. var body io.Reader = nil
  13308. c.urlParams_.Set("alt", alt)
  13309. c.urlParams_.Set("prettyPrint", "false")
  13310. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
  13311. urls += "?" + c.urlParams_.Encode()
  13312. req, err := http.NewRequest("GET", urls, body)
  13313. if err != nil {
  13314. return nil, err
  13315. }
  13316. req.Header = reqHeaders
  13317. googleapi.Expand(req.URL, map[string]string{
  13318. "enterpriseId": c.enterpriseId,
  13319. "userId": c.userId,
  13320. })
  13321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13322. }
  13323. // Do executes the "androidenterprise.users.getAvailableProductSet" call.
  13324. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  13325. // status code is an error. Response headers are in either
  13326. // *ProductSet.ServerResponse.Header or (if a response was returned at
  13327. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13328. // to check whether the returned error was because
  13329. // http.StatusNotModified was returned.
  13330. func (c *UsersGetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  13331. gensupport.SetOptions(c.urlParams_, opts...)
  13332. res, err := c.doRequest("json")
  13333. if res != nil && res.StatusCode == http.StatusNotModified {
  13334. if res.Body != nil {
  13335. res.Body.Close()
  13336. }
  13337. return nil, &googleapi.Error{
  13338. Code: res.StatusCode,
  13339. Header: res.Header,
  13340. }
  13341. }
  13342. if err != nil {
  13343. return nil, err
  13344. }
  13345. defer googleapi.CloseBody(res)
  13346. if err := googleapi.CheckResponse(res); err != nil {
  13347. return nil, err
  13348. }
  13349. ret := &ProductSet{
  13350. ServerResponse: googleapi.ServerResponse{
  13351. Header: res.Header,
  13352. HTTPStatusCode: res.StatusCode,
  13353. },
  13354. }
  13355. target := &ret
  13356. if err := gensupport.DecodeResponse(target, res); err != nil {
  13357. return nil, err
  13358. }
  13359. return ret, nil
  13360. // {
  13361. // "description": "Retrieves the set of products a user is entitled to access.",
  13362. // "httpMethod": "GET",
  13363. // "id": "androidenterprise.users.getAvailableProductSet",
  13364. // "parameterOrder": [
  13365. // "enterpriseId",
  13366. // "userId"
  13367. // ],
  13368. // "parameters": {
  13369. // "enterpriseId": {
  13370. // "description": "The ID of the enterprise.",
  13371. // "location": "path",
  13372. // "required": true,
  13373. // "type": "string"
  13374. // },
  13375. // "userId": {
  13376. // "description": "The ID of the user.",
  13377. // "location": "path",
  13378. // "required": true,
  13379. // "type": "string"
  13380. // }
  13381. // },
  13382. // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
  13383. // "response": {
  13384. // "$ref": "ProductSet"
  13385. // },
  13386. // "scopes": [
  13387. // "https://www.googleapis.com/auth/androidenterprise"
  13388. // ]
  13389. // }
  13390. }
  13391. // method id "androidenterprise.users.insert":
  13392. type UsersInsertCall struct {
  13393. s *Service
  13394. enterpriseId string
  13395. user *User
  13396. urlParams_ gensupport.URLParams
  13397. ctx_ context.Context
  13398. header_ http.Header
  13399. }
  13400. // Insert: Creates a new EMM-managed user.
  13401. //
  13402. // The Users resource passed in the body of the request should include
  13403. // an accountIdentifier and an accountType.
  13404. // If a corresponding user already exists with the same account
  13405. // identifier, the user will be updated with the resource. In this case
  13406. // only the displayName field can be changed.
  13407. func (r *UsersService) Insert(enterpriseId string, user *User) *UsersInsertCall {
  13408. c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13409. c.enterpriseId = enterpriseId
  13410. c.user = user
  13411. return c
  13412. }
  13413. // Fields allows partial responses to be retrieved. See
  13414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13415. // for more information.
  13416. func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
  13417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13418. return c
  13419. }
  13420. // Context sets the context to be used in this call's Do method. Any
  13421. // pending HTTP request will be aborted if the provided context is
  13422. // canceled.
  13423. func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
  13424. c.ctx_ = ctx
  13425. return c
  13426. }
  13427. // Header returns an http.Header that can be modified by the caller to
  13428. // add HTTP headers to the request.
  13429. func (c *UsersInsertCall) Header() http.Header {
  13430. if c.header_ == nil {
  13431. c.header_ = make(http.Header)
  13432. }
  13433. return c.header_
  13434. }
  13435. func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
  13436. reqHeaders := make(http.Header)
  13437. for k, v := range c.header_ {
  13438. reqHeaders[k] = v
  13439. }
  13440. reqHeaders.Set("User-Agent", c.s.userAgent())
  13441. var body io.Reader = nil
  13442. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  13443. if err != nil {
  13444. return nil, err
  13445. }
  13446. reqHeaders.Set("Content-Type", "application/json")
  13447. c.urlParams_.Set("alt", alt)
  13448. c.urlParams_.Set("prettyPrint", "false")
  13449. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users")
  13450. urls += "?" + c.urlParams_.Encode()
  13451. req, err := http.NewRequest("POST", urls, body)
  13452. if err != nil {
  13453. return nil, err
  13454. }
  13455. req.Header = reqHeaders
  13456. googleapi.Expand(req.URL, map[string]string{
  13457. "enterpriseId": c.enterpriseId,
  13458. })
  13459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13460. }
  13461. // Do executes the "androidenterprise.users.insert" call.
  13462. // Exactly one of *User or error will be non-nil. Any non-2xx status
  13463. // code is an error. Response headers are in either
  13464. // *User.ServerResponse.Header or (if a response was returned at all) in
  13465. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13466. // whether the returned error was because http.StatusNotModified was
  13467. // returned.
  13468. func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) {
  13469. gensupport.SetOptions(c.urlParams_, opts...)
  13470. res, err := c.doRequest("json")
  13471. if res != nil && res.StatusCode == http.StatusNotModified {
  13472. if res.Body != nil {
  13473. res.Body.Close()
  13474. }
  13475. return nil, &googleapi.Error{
  13476. Code: res.StatusCode,
  13477. Header: res.Header,
  13478. }
  13479. }
  13480. if err != nil {
  13481. return nil, err
  13482. }
  13483. defer googleapi.CloseBody(res)
  13484. if err := googleapi.CheckResponse(res); err != nil {
  13485. return nil, err
  13486. }
  13487. ret := &User{
  13488. ServerResponse: googleapi.ServerResponse{
  13489. Header: res.Header,
  13490. HTTPStatusCode: res.StatusCode,
  13491. },
  13492. }
  13493. target := &ret
  13494. if err := gensupport.DecodeResponse(target, res); err != nil {
  13495. return nil, err
  13496. }
  13497. return ret, nil
  13498. // {
  13499. // "description": "Creates a new EMM-managed user.\n\nThe Users resource passed in the body of the request should include an accountIdentifier and an accountType.\nIf a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed.",
  13500. // "httpMethod": "POST",
  13501. // "id": "androidenterprise.users.insert",
  13502. // "parameterOrder": [
  13503. // "enterpriseId"
  13504. // ],
  13505. // "parameters": {
  13506. // "enterpriseId": {
  13507. // "description": "The ID of the enterprise.",
  13508. // "location": "path",
  13509. // "required": true,
  13510. // "type": "string"
  13511. // }
  13512. // },
  13513. // "path": "enterprises/{enterpriseId}/users",
  13514. // "request": {
  13515. // "$ref": "User"
  13516. // },
  13517. // "response": {
  13518. // "$ref": "User"
  13519. // },
  13520. // "scopes": [
  13521. // "https://www.googleapis.com/auth/androidenterprise"
  13522. // ]
  13523. // }
  13524. }
  13525. // method id "androidenterprise.users.list":
  13526. type UsersListCall struct {
  13527. s *Service
  13528. enterpriseId string
  13529. urlParams_ gensupport.URLParams
  13530. ifNoneMatch_ string
  13531. ctx_ context.Context
  13532. header_ http.Header
  13533. }
  13534. // List: Looks up a user by primary email address. This is only
  13535. // supported for Google-managed users. Lookup of the id is not needed
  13536. // for EMM-managed users because the id is already returned in the
  13537. // result of the Users.insert call.
  13538. func (r *UsersService) List(enterpriseId string, email string) *UsersListCall {
  13539. c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13540. c.enterpriseId = enterpriseId
  13541. c.urlParams_.Set("email", email)
  13542. return c
  13543. }
  13544. // Fields allows partial responses to be retrieved. See
  13545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13546. // for more information.
  13547. func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
  13548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13549. return c
  13550. }
  13551. // IfNoneMatch sets the optional parameter which makes the operation
  13552. // fail if the object's ETag matches the given value. This is useful for
  13553. // getting updates only after the object has changed since the last
  13554. // request. Use googleapi.IsNotModified to check whether the response
  13555. // error from Do is the result of In-None-Match.
  13556. func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
  13557. c.ifNoneMatch_ = entityTag
  13558. return c
  13559. }
  13560. // Context sets the context to be used in this call's Do method. Any
  13561. // pending HTTP request will be aborted if the provided context is
  13562. // canceled.
  13563. func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
  13564. c.ctx_ = ctx
  13565. return c
  13566. }
  13567. // Header returns an http.Header that can be modified by the caller to
  13568. // add HTTP headers to the request.
  13569. func (c *UsersListCall) Header() http.Header {
  13570. if c.header_ == nil {
  13571. c.header_ = make(http.Header)
  13572. }
  13573. return c.header_
  13574. }
  13575. func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
  13576. reqHeaders := make(http.Header)
  13577. for k, v := range c.header_ {
  13578. reqHeaders[k] = v
  13579. }
  13580. reqHeaders.Set("User-Agent", c.s.userAgent())
  13581. if c.ifNoneMatch_ != "" {
  13582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13583. }
  13584. var body io.Reader = nil
  13585. c.urlParams_.Set("alt", alt)
  13586. c.urlParams_.Set("prettyPrint", "false")
  13587. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users")
  13588. urls += "?" + c.urlParams_.Encode()
  13589. req, err := http.NewRequest("GET", urls, body)
  13590. if err != nil {
  13591. return nil, err
  13592. }
  13593. req.Header = reqHeaders
  13594. googleapi.Expand(req.URL, map[string]string{
  13595. "enterpriseId": c.enterpriseId,
  13596. })
  13597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13598. }
  13599. // Do executes the "androidenterprise.users.list" call.
  13600. // Exactly one of *UsersListResponse or error will be non-nil. Any
  13601. // non-2xx status code is an error. Response headers are in either
  13602. // *UsersListResponse.ServerResponse.Header or (if a response was
  13603. // returned at all) in error.(*googleapi.Error).Header. Use
  13604. // googleapi.IsNotModified to check whether the returned error was
  13605. // because http.StatusNotModified was returned.
  13606. func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
  13607. gensupport.SetOptions(c.urlParams_, opts...)
  13608. res, err := c.doRequest("json")
  13609. if res != nil && res.StatusCode == http.StatusNotModified {
  13610. if res.Body != nil {
  13611. res.Body.Close()
  13612. }
  13613. return nil, &googleapi.Error{
  13614. Code: res.StatusCode,
  13615. Header: res.Header,
  13616. }
  13617. }
  13618. if err != nil {
  13619. return nil, err
  13620. }
  13621. defer googleapi.CloseBody(res)
  13622. if err := googleapi.CheckResponse(res); err != nil {
  13623. return nil, err
  13624. }
  13625. ret := &UsersListResponse{
  13626. ServerResponse: googleapi.ServerResponse{
  13627. Header: res.Header,
  13628. HTTPStatusCode: res.StatusCode,
  13629. },
  13630. }
  13631. target := &ret
  13632. if err := gensupport.DecodeResponse(target, res); err != nil {
  13633. return nil, err
  13634. }
  13635. return ret, nil
  13636. // {
  13637. // "description": "Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call.",
  13638. // "httpMethod": "GET",
  13639. // "id": "androidenterprise.users.list",
  13640. // "parameterOrder": [
  13641. // "enterpriseId",
  13642. // "email"
  13643. // ],
  13644. // "parameters": {
  13645. // "email": {
  13646. // "description": "The exact primary email address of the user to look up.",
  13647. // "location": "query",
  13648. // "required": true,
  13649. // "type": "string"
  13650. // },
  13651. // "enterpriseId": {
  13652. // "description": "The ID of the enterprise.",
  13653. // "location": "path",
  13654. // "required": true,
  13655. // "type": "string"
  13656. // }
  13657. // },
  13658. // "path": "enterprises/{enterpriseId}/users",
  13659. // "response": {
  13660. // "$ref": "UsersListResponse"
  13661. // },
  13662. // "scopes": [
  13663. // "https://www.googleapis.com/auth/androidenterprise"
  13664. // ]
  13665. // }
  13666. }
  13667. // method id "androidenterprise.users.patch":
  13668. type UsersPatchCall struct {
  13669. s *Service
  13670. enterpriseId string
  13671. userId string
  13672. user *User
  13673. urlParams_ gensupport.URLParams
  13674. ctx_ context.Context
  13675. header_ http.Header
  13676. }
  13677. // Patch: Updates the details of an EMM-managed user.
  13678. //
  13679. // Can be used with EMM-managed users only (not Google managed users).
  13680. // Pass the new details in the Users resource in the request body. Only
  13681. // the displayName field can be changed. Other fields must either be
  13682. // unset or have the currently active value. This method supports patch
  13683. // semantics.
  13684. func (r *UsersService) Patch(enterpriseId string, userId string, user *User) *UsersPatchCall {
  13685. c := &UsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13686. c.enterpriseId = enterpriseId
  13687. c.userId = userId
  13688. c.user = user
  13689. return c
  13690. }
  13691. // Fields allows partial responses to be retrieved. See
  13692. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13693. // for more information.
  13694. func (c *UsersPatchCall) Fields(s ...googleapi.Field) *UsersPatchCall {
  13695. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13696. return c
  13697. }
  13698. // Context sets the context to be used in this call's Do method. Any
  13699. // pending HTTP request will be aborted if the provided context is
  13700. // canceled.
  13701. func (c *UsersPatchCall) Context(ctx context.Context) *UsersPatchCall {
  13702. c.ctx_ = ctx
  13703. return c
  13704. }
  13705. // Header returns an http.Header that can be modified by the caller to
  13706. // add HTTP headers to the request.
  13707. func (c *UsersPatchCall) Header() http.Header {
  13708. if c.header_ == nil {
  13709. c.header_ = make(http.Header)
  13710. }
  13711. return c.header_
  13712. }
  13713. func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) {
  13714. reqHeaders := make(http.Header)
  13715. for k, v := range c.header_ {
  13716. reqHeaders[k] = v
  13717. }
  13718. reqHeaders.Set("User-Agent", c.s.userAgent())
  13719. var body io.Reader = nil
  13720. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  13721. if err != nil {
  13722. return nil, err
  13723. }
  13724. reqHeaders.Set("Content-Type", "application/json")
  13725. c.urlParams_.Set("alt", alt)
  13726. c.urlParams_.Set("prettyPrint", "false")
  13727. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  13728. urls += "?" + c.urlParams_.Encode()
  13729. req, err := http.NewRequest("PATCH", urls, body)
  13730. if err != nil {
  13731. return nil, err
  13732. }
  13733. req.Header = reqHeaders
  13734. googleapi.Expand(req.URL, map[string]string{
  13735. "enterpriseId": c.enterpriseId,
  13736. "userId": c.userId,
  13737. })
  13738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13739. }
  13740. // Do executes the "androidenterprise.users.patch" call.
  13741. // Exactly one of *User or error will be non-nil. Any non-2xx status
  13742. // code is an error. Response headers are in either
  13743. // *User.ServerResponse.Header or (if a response was returned at all) in
  13744. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13745. // whether the returned error was because http.StatusNotModified was
  13746. // returned.
  13747. func (c *UsersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) {
  13748. gensupport.SetOptions(c.urlParams_, opts...)
  13749. res, err := c.doRequest("json")
  13750. if res != nil && res.StatusCode == http.StatusNotModified {
  13751. if res.Body != nil {
  13752. res.Body.Close()
  13753. }
  13754. return nil, &googleapi.Error{
  13755. Code: res.StatusCode,
  13756. Header: res.Header,
  13757. }
  13758. }
  13759. if err != nil {
  13760. return nil, err
  13761. }
  13762. defer googleapi.CloseBody(res)
  13763. if err := googleapi.CheckResponse(res); err != nil {
  13764. return nil, err
  13765. }
  13766. ret := &User{
  13767. ServerResponse: googleapi.ServerResponse{
  13768. Header: res.Header,
  13769. HTTPStatusCode: res.StatusCode,
  13770. },
  13771. }
  13772. target := &ret
  13773. if err := gensupport.DecodeResponse(target, res); err != nil {
  13774. return nil, err
  13775. }
  13776. return ret, nil
  13777. // {
  13778. // "description": "Updates the details of an EMM-managed user.\n\nCan be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics.",
  13779. // "httpMethod": "PATCH",
  13780. // "id": "androidenterprise.users.patch",
  13781. // "parameterOrder": [
  13782. // "enterpriseId",
  13783. // "userId"
  13784. // ],
  13785. // "parameters": {
  13786. // "enterpriseId": {
  13787. // "description": "The ID of the enterprise.",
  13788. // "location": "path",
  13789. // "required": true,
  13790. // "type": "string"
  13791. // },
  13792. // "userId": {
  13793. // "description": "The ID of the user.",
  13794. // "location": "path",
  13795. // "required": true,
  13796. // "type": "string"
  13797. // }
  13798. // },
  13799. // "path": "enterprises/{enterpriseId}/users/{userId}",
  13800. // "request": {
  13801. // "$ref": "User"
  13802. // },
  13803. // "response": {
  13804. // "$ref": "User"
  13805. // },
  13806. // "scopes": [
  13807. // "https://www.googleapis.com/auth/androidenterprise"
  13808. // ]
  13809. // }
  13810. }
  13811. // method id "androidenterprise.users.revokeDeviceAccess":
  13812. type UsersRevokeDeviceAccessCall struct {
  13813. s *Service
  13814. enterpriseId string
  13815. userId string
  13816. urlParams_ gensupport.URLParams
  13817. ctx_ context.Context
  13818. header_ http.Header
  13819. }
  13820. // RevokeDeviceAccess: Revokes access to all devices currently
  13821. // provisioned to the user. The user will no longer be able to use the
  13822. // managed Play store on any of their managed devices.
  13823. //
  13824. // This call only works with EMM-managed accounts.
  13825. func (r *UsersService) RevokeDeviceAccess(enterpriseId string, userId string) *UsersRevokeDeviceAccessCall {
  13826. c := &UsersRevokeDeviceAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13827. c.enterpriseId = enterpriseId
  13828. c.userId = userId
  13829. return c
  13830. }
  13831. // Fields allows partial responses to be retrieved. See
  13832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13833. // for more information.
  13834. func (c *UsersRevokeDeviceAccessCall) Fields(s ...googleapi.Field) *UsersRevokeDeviceAccessCall {
  13835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13836. return c
  13837. }
  13838. // Context sets the context to be used in this call's Do method. Any
  13839. // pending HTTP request will be aborted if the provided context is
  13840. // canceled.
  13841. func (c *UsersRevokeDeviceAccessCall) Context(ctx context.Context) *UsersRevokeDeviceAccessCall {
  13842. c.ctx_ = ctx
  13843. return c
  13844. }
  13845. // Header returns an http.Header that can be modified by the caller to
  13846. // add HTTP headers to the request.
  13847. func (c *UsersRevokeDeviceAccessCall) Header() http.Header {
  13848. if c.header_ == nil {
  13849. c.header_ = make(http.Header)
  13850. }
  13851. return c.header_
  13852. }
  13853. func (c *UsersRevokeDeviceAccessCall) doRequest(alt string) (*http.Response, error) {
  13854. reqHeaders := make(http.Header)
  13855. for k, v := range c.header_ {
  13856. reqHeaders[k] = v
  13857. }
  13858. reqHeaders.Set("User-Agent", c.s.userAgent())
  13859. var body io.Reader = nil
  13860. c.urlParams_.Set("alt", alt)
  13861. c.urlParams_.Set("prettyPrint", "false")
  13862. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/deviceAccess")
  13863. urls += "?" + c.urlParams_.Encode()
  13864. req, err := http.NewRequest("DELETE", urls, body)
  13865. if err != nil {
  13866. return nil, err
  13867. }
  13868. req.Header = reqHeaders
  13869. googleapi.Expand(req.URL, map[string]string{
  13870. "enterpriseId": c.enterpriseId,
  13871. "userId": c.userId,
  13872. })
  13873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13874. }
  13875. // Do executes the "androidenterprise.users.revokeDeviceAccess" call.
  13876. func (c *UsersRevokeDeviceAccessCall) Do(opts ...googleapi.CallOption) error {
  13877. gensupport.SetOptions(c.urlParams_, opts...)
  13878. res, err := c.doRequest("json")
  13879. if err != nil {
  13880. return err
  13881. }
  13882. defer googleapi.CloseBody(res)
  13883. if err := googleapi.CheckResponse(res); err != nil {
  13884. return err
  13885. }
  13886. return nil
  13887. // {
  13888. // "description": "Revokes access to all devices currently provisioned to the user. The user will no longer be able to use the managed Play store on any of their managed devices.\n\nThis call only works with EMM-managed accounts.",
  13889. // "httpMethod": "DELETE",
  13890. // "id": "androidenterprise.users.revokeDeviceAccess",
  13891. // "parameterOrder": [
  13892. // "enterpriseId",
  13893. // "userId"
  13894. // ],
  13895. // "parameters": {
  13896. // "enterpriseId": {
  13897. // "description": "The ID of the enterprise.",
  13898. // "location": "path",
  13899. // "required": true,
  13900. // "type": "string"
  13901. // },
  13902. // "userId": {
  13903. // "description": "The ID of the user.",
  13904. // "location": "path",
  13905. // "required": true,
  13906. // "type": "string"
  13907. // }
  13908. // },
  13909. // "path": "enterprises/{enterpriseId}/users/{userId}/deviceAccess",
  13910. // "scopes": [
  13911. // "https://www.googleapis.com/auth/androidenterprise"
  13912. // ]
  13913. // }
  13914. }
  13915. // method id "androidenterprise.users.revokeToken":
  13916. type UsersRevokeTokenCall struct {
  13917. s *Service
  13918. enterpriseId string
  13919. userId string
  13920. urlParams_ gensupport.URLParams
  13921. ctx_ context.Context
  13922. header_ http.Header
  13923. }
  13924. // RevokeToken: Revokes a previously generated token (activation code)
  13925. // for the user.
  13926. func (r *UsersService) RevokeToken(enterpriseId string, userId string) *UsersRevokeTokenCall {
  13927. c := &UsersRevokeTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13928. c.enterpriseId = enterpriseId
  13929. c.userId = userId
  13930. return c
  13931. }
  13932. // Fields allows partial responses to be retrieved. See
  13933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13934. // for more information.
  13935. func (c *UsersRevokeTokenCall) Fields(s ...googleapi.Field) *UsersRevokeTokenCall {
  13936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13937. return c
  13938. }
  13939. // Context sets the context to be used in this call's Do method. Any
  13940. // pending HTTP request will be aborted if the provided context is
  13941. // canceled.
  13942. func (c *UsersRevokeTokenCall) Context(ctx context.Context) *UsersRevokeTokenCall {
  13943. c.ctx_ = ctx
  13944. return c
  13945. }
  13946. // Header returns an http.Header that can be modified by the caller to
  13947. // add HTTP headers to the request.
  13948. func (c *UsersRevokeTokenCall) Header() http.Header {
  13949. if c.header_ == nil {
  13950. c.header_ = make(http.Header)
  13951. }
  13952. return c.header_
  13953. }
  13954. func (c *UsersRevokeTokenCall) doRequest(alt string) (*http.Response, error) {
  13955. reqHeaders := make(http.Header)
  13956. for k, v := range c.header_ {
  13957. reqHeaders[k] = v
  13958. }
  13959. reqHeaders.Set("User-Agent", c.s.userAgent())
  13960. var body io.Reader = nil
  13961. c.urlParams_.Set("alt", alt)
  13962. c.urlParams_.Set("prettyPrint", "false")
  13963. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
  13964. urls += "?" + c.urlParams_.Encode()
  13965. req, err := http.NewRequest("DELETE", urls, body)
  13966. if err != nil {
  13967. return nil, err
  13968. }
  13969. req.Header = reqHeaders
  13970. googleapi.Expand(req.URL, map[string]string{
  13971. "enterpriseId": c.enterpriseId,
  13972. "userId": c.userId,
  13973. })
  13974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13975. }
  13976. // Do executes the "androidenterprise.users.revokeToken" call.
  13977. func (c *UsersRevokeTokenCall) Do(opts ...googleapi.CallOption) error {
  13978. gensupport.SetOptions(c.urlParams_, opts...)
  13979. res, err := c.doRequest("json")
  13980. if err != nil {
  13981. return err
  13982. }
  13983. defer googleapi.CloseBody(res)
  13984. if err := googleapi.CheckResponse(res); err != nil {
  13985. return err
  13986. }
  13987. return nil
  13988. // {
  13989. // "description": "Revokes a previously generated token (activation code) for the user.",
  13990. // "httpMethod": "DELETE",
  13991. // "id": "androidenterprise.users.revokeToken",
  13992. // "parameterOrder": [
  13993. // "enterpriseId",
  13994. // "userId"
  13995. // ],
  13996. // "parameters": {
  13997. // "enterpriseId": {
  13998. // "description": "The ID of the enterprise.",
  13999. // "location": "path",
  14000. // "required": true,
  14001. // "type": "string"
  14002. // },
  14003. // "userId": {
  14004. // "description": "The ID of the user.",
  14005. // "location": "path",
  14006. // "required": true,
  14007. // "type": "string"
  14008. // }
  14009. // },
  14010. // "path": "enterprises/{enterpriseId}/users/{userId}/token",
  14011. // "scopes": [
  14012. // "https://www.googleapis.com/auth/androidenterprise"
  14013. // ]
  14014. // }
  14015. }
  14016. // method id "androidenterprise.users.setAvailableProductSet":
  14017. type UsersSetAvailableProductSetCall struct {
  14018. s *Service
  14019. enterpriseId string
  14020. userId string
  14021. productset *ProductSet
  14022. urlParams_ gensupport.URLParams
  14023. ctx_ context.Context
  14024. header_ http.Header
  14025. }
  14026. // SetAvailableProductSet: Modifies the set of products that a user is
  14027. // entitled to access (referred to as whitelisted products). Only
  14028. // products that are approved or products that were previously approved
  14029. // (products with revoked approval) can be whitelisted.
  14030. func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall {
  14031. c := &UsersSetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14032. c.enterpriseId = enterpriseId
  14033. c.userId = userId
  14034. c.productset = productset
  14035. return c
  14036. }
  14037. // Fields allows partial responses to be retrieved. See
  14038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14039. // for more information.
  14040. func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall {
  14041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14042. return c
  14043. }
  14044. // Context sets the context to be used in this call's Do method. Any
  14045. // pending HTTP request will be aborted if the provided context is
  14046. // canceled.
  14047. func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall {
  14048. c.ctx_ = ctx
  14049. return c
  14050. }
  14051. // Header returns an http.Header that can be modified by the caller to
  14052. // add HTTP headers to the request.
  14053. func (c *UsersSetAvailableProductSetCall) Header() http.Header {
  14054. if c.header_ == nil {
  14055. c.header_ = make(http.Header)
  14056. }
  14057. return c.header_
  14058. }
  14059. func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
  14060. reqHeaders := make(http.Header)
  14061. for k, v := range c.header_ {
  14062. reqHeaders[k] = v
  14063. }
  14064. reqHeaders.Set("User-Agent", c.s.userAgent())
  14065. var body io.Reader = nil
  14066. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset)
  14067. if err != nil {
  14068. return nil, err
  14069. }
  14070. reqHeaders.Set("Content-Type", "application/json")
  14071. c.urlParams_.Set("alt", alt)
  14072. c.urlParams_.Set("prettyPrint", "false")
  14073. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
  14074. urls += "?" + c.urlParams_.Encode()
  14075. req, err := http.NewRequest("PUT", urls, body)
  14076. if err != nil {
  14077. return nil, err
  14078. }
  14079. req.Header = reqHeaders
  14080. googleapi.Expand(req.URL, map[string]string{
  14081. "enterpriseId": c.enterpriseId,
  14082. "userId": c.userId,
  14083. })
  14084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14085. }
  14086. // Do executes the "androidenterprise.users.setAvailableProductSet" call.
  14087. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  14088. // status code is an error. Response headers are in either
  14089. // *ProductSet.ServerResponse.Header or (if a response was returned at
  14090. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14091. // to check whether the returned error was because
  14092. // http.StatusNotModified was returned.
  14093. func (c *UsersSetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  14094. gensupport.SetOptions(c.urlParams_, opts...)
  14095. res, err := c.doRequest("json")
  14096. if res != nil && res.StatusCode == http.StatusNotModified {
  14097. if res.Body != nil {
  14098. res.Body.Close()
  14099. }
  14100. return nil, &googleapi.Error{
  14101. Code: res.StatusCode,
  14102. Header: res.Header,
  14103. }
  14104. }
  14105. if err != nil {
  14106. return nil, err
  14107. }
  14108. defer googleapi.CloseBody(res)
  14109. if err := googleapi.CheckResponse(res); err != nil {
  14110. return nil, err
  14111. }
  14112. ret := &ProductSet{
  14113. ServerResponse: googleapi.ServerResponse{
  14114. Header: res.Header,
  14115. HTTPStatusCode: res.StatusCode,
  14116. },
  14117. }
  14118. target := &ret
  14119. if err := gensupport.DecodeResponse(target, res); err != nil {
  14120. return nil, err
  14121. }
  14122. return ret, nil
  14123. // {
  14124. // "description": "Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted.",
  14125. // "httpMethod": "PUT",
  14126. // "id": "androidenterprise.users.setAvailableProductSet",
  14127. // "parameterOrder": [
  14128. // "enterpriseId",
  14129. // "userId"
  14130. // ],
  14131. // "parameters": {
  14132. // "enterpriseId": {
  14133. // "description": "The ID of the enterprise.",
  14134. // "location": "path",
  14135. // "required": true,
  14136. // "type": "string"
  14137. // },
  14138. // "userId": {
  14139. // "description": "The ID of the user.",
  14140. // "location": "path",
  14141. // "required": true,
  14142. // "type": "string"
  14143. // }
  14144. // },
  14145. // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
  14146. // "request": {
  14147. // "$ref": "ProductSet"
  14148. // },
  14149. // "response": {
  14150. // "$ref": "ProductSet"
  14151. // },
  14152. // "scopes": [
  14153. // "https://www.googleapis.com/auth/androidenterprise"
  14154. // ]
  14155. // }
  14156. }
  14157. // method id "androidenterprise.users.update":
  14158. type UsersUpdateCall struct {
  14159. s *Service
  14160. enterpriseId string
  14161. userId string
  14162. user *User
  14163. urlParams_ gensupport.URLParams
  14164. ctx_ context.Context
  14165. header_ http.Header
  14166. }
  14167. // Update: Updates the details of an EMM-managed user.
  14168. //
  14169. // Can be used with EMM-managed users only (not Google managed users).
  14170. // Pass the new details in the Users resource in the request body. Only
  14171. // the displayName field can be changed. Other fields must either be
  14172. // unset or have the currently active value.
  14173. func (r *UsersService) Update(enterpriseId string, userId string, user *User) *UsersUpdateCall {
  14174. c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14175. c.enterpriseId = enterpriseId
  14176. c.userId = userId
  14177. c.user = user
  14178. return c
  14179. }
  14180. // Fields allows partial responses to be retrieved. See
  14181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14182. // for more information.
  14183. func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall {
  14184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14185. return c
  14186. }
  14187. // Context sets the context to be used in this call's Do method. Any
  14188. // pending HTTP request will be aborted if the provided context is
  14189. // canceled.
  14190. func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall {
  14191. c.ctx_ = ctx
  14192. return c
  14193. }
  14194. // Header returns an http.Header that can be modified by the caller to
  14195. // add HTTP headers to the request.
  14196. func (c *UsersUpdateCall) Header() http.Header {
  14197. if c.header_ == nil {
  14198. c.header_ = make(http.Header)
  14199. }
  14200. return c.header_
  14201. }
  14202. func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) {
  14203. reqHeaders := make(http.Header)
  14204. for k, v := range c.header_ {
  14205. reqHeaders[k] = v
  14206. }
  14207. reqHeaders.Set("User-Agent", c.s.userAgent())
  14208. var body io.Reader = nil
  14209. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  14210. if err != nil {
  14211. return nil, err
  14212. }
  14213. reqHeaders.Set("Content-Type", "application/json")
  14214. c.urlParams_.Set("alt", alt)
  14215. c.urlParams_.Set("prettyPrint", "false")
  14216. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  14217. urls += "?" + c.urlParams_.Encode()
  14218. req, err := http.NewRequest("PUT", urls, body)
  14219. if err != nil {
  14220. return nil, err
  14221. }
  14222. req.Header = reqHeaders
  14223. googleapi.Expand(req.URL, map[string]string{
  14224. "enterpriseId": c.enterpriseId,
  14225. "userId": c.userId,
  14226. })
  14227. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14228. }
  14229. // Do executes the "androidenterprise.users.update" call.
  14230. // Exactly one of *User or error will be non-nil. Any non-2xx status
  14231. // code is an error. Response headers are in either
  14232. // *User.ServerResponse.Header or (if a response was returned at all) in
  14233. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14234. // whether the returned error was because http.StatusNotModified was
  14235. // returned.
  14236. func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) {
  14237. gensupport.SetOptions(c.urlParams_, opts...)
  14238. res, err := c.doRequest("json")
  14239. if res != nil && res.StatusCode == http.StatusNotModified {
  14240. if res.Body != nil {
  14241. res.Body.Close()
  14242. }
  14243. return nil, &googleapi.Error{
  14244. Code: res.StatusCode,
  14245. Header: res.Header,
  14246. }
  14247. }
  14248. if err != nil {
  14249. return nil, err
  14250. }
  14251. defer googleapi.CloseBody(res)
  14252. if err := googleapi.CheckResponse(res); err != nil {
  14253. return nil, err
  14254. }
  14255. ret := &User{
  14256. ServerResponse: googleapi.ServerResponse{
  14257. Header: res.Header,
  14258. HTTPStatusCode: res.StatusCode,
  14259. },
  14260. }
  14261. target := &ret
  14262. if err := gensupport.DecodeResponse(target, res); err != nil {
  14263. return nil, err
  14264. }
  14265. return ret, nil
  14266. // {
  14267. // "description": "Updates the details of an EMM-managed user.\n\nCan be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value.",
  14268. // "httpMethod": "PUT",
  14269. // "id": "androidenterprise.users.update",
  14270. // "parameterOrder": [
  14271. // "enterpriseId",
  14272. // "userId"
  14273. // ],
  14274. // "parameters": {
  14275. // "enterpriseId": {
  14276. // "description": "The ID of the enterprise.",
  14277. // "location": "path",
  14278. // "required": true,
  14279. // "type": "string"
  14280. // },
  14281. // "userId": {
  14282. // "description": "The ID of the user.",
  14283. // "location": "path",
  14284. // "required": true,
  14285. // "type": "string"
  14286. // }
  14287. // },
  14288. // "path": "enterprises/{enterpriseId}/users/{userId}",
  14289. // "request": {
  14290. // "$ref": "User"
  14291. // },
  14292. // "response": {
  14293. // "$ref": "User"
  14294. // },
  14295. // "scopes": [
  14296. // "https://www.googleapis.com/auth/androidenterprise"
  14297. // ]
  14298. // }
  14299. }
  14300. // method id "androidenterprise.webapps.delete":
  14301. type WebappsDeleteCall struct {
  14302. s *Service
  14303. enterpriseId string
  14304. webAppId string
  14305. urlParams_ gensupport.URLParams
  14306. ctx_ context.Context
  14307. header_ http.Header
  14308. }
  14309. // Delete: Deletes an existing web app.
  14310. func (r *WebappsService) Delete(enterpriseId string, webAppId string) *WebappsDeleteCall {
  14311. c := &WebappsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14312. c.enterpriseId = enterpriseId
  14313. c.webAppId = webAppId
  14314. return c
  14315. }
  14316. // Fields allows partial responses to be retrieved. See
  14317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14318. // for more information.
  14319. func (c *WebappsDeleteCall) Fields(s ...googleapi.Field) *WebappsDeleteCall {
  14320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14321. return c
  14322. }
  14323. // Context sets the context to be used in this call's Do method. Any
  14324. // pending HTTP request will be aborted if the provided context is
  14325. // canceled.
  14326. func (c *WebappsDeleteCall) Context(ctx context.Context) *WebappsDeleteCall {
  14327. c.ctx_ = ctx
  14328. return c
  14329. }
  14330. // Header returns an http.Header that can be modified by the caller to
  14331. // add HTTP headers to the request.
  14332. func (c *WebappsDeleteCall) Header() http.Header {
  14333. if c.header_ == nil {
  14334. c.header_ = make(http.Header)
  14335. }
  14336. return c.header_
  14337. }
  14338. func (c *WebappsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14339. reqHeaders := make(http.Header)
  14340. for k, v := range c.header_ {
  14341. reqHeaders[k] = v
  14342. }
  14343. reqHeaders.Set("User-Agent", c.s.userAgent())
  14344. var body io.Reader = nil
  14345. c.urlParams_.Set("alt", alt)
  14346. c.urlParams_.Set("prettyPrint", "false")
  14347. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}")
  14348. urls += "?" + c.urlParams_.Encode()
  14349. req, err := http.NewRequest("DELETE", urls, body)
  14350. if err != nil {
  14351. return nil, err
  14352. }
  14353. req.Header = reqHeaders
  14354. googleapi.Expand(req.URL, map[string]string{
  14355. "enterpriseId": c.enterpriseId,
  14356. "webAppId": c.webAppId,
  14357. })
  14358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14359. }
  14360. // Do executes the "androidenterprise.webapps.delete" call.
  14361. func (c *WebappsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14362. gensupport.SetOptions(c.urlParams_, opts...)
  14363. res, err := c.doRequest("json")
  14364. if err != nil {
  14365. return err
  14366. }
  14367. defer googleapi.CloseBody(res)
  14368. if err := googleapi.CheckResponse(res); err != nil {
  14369. return err
  14370. }
  14371. return nil
  14372. // {
  14373. // "description": "Deletes an existing web app.",
  14374. // "httpMethod": "DELETE",
  14375. // "id": "androidenterprise.webapps.delete",
  14376. // "parameterOrder": [
  14377. // "enterpriseId",
  14378. // "webAppId"
  14379. // ],
  14380. // "parameters": {
  14381. // "enterpriseId": {
  14382. // "description": "The ID of the enterprise.",
  14383. // "location": "path",
  14384. // "required": true,
  14385. // "type": "string"
  14386. // },
  14387. // "webAppId": {
  14388. // "description": "The ID of the web app.",
  14389. // "location": "path",
  14390. // "required": true,
  14391. // "type": "string"
  14392. // }
  14393. // },
  14394. // "path": "enterprises/{enterpriseId}/webApps/{webAppId}",
  14395. // "scopes": [
  14396. // "https://www.googleapis.com/auth/androidenterprise"
  14397. // ]
  14398. // }
  14399. }
  14400. // method id "androidenterprise.webapps.get":
  14401. type WebappsGetCall struct {
  14402. s *Service
  14403. enterpriseId string
  14404. webAppId string
  14405. urlParams_ gensupport.URLParams
  14406. ifNoneMatch_ string
  14407. ctx_ context.Context
  14408. header_ http.Header
  14409. }
  14410. // Get: Gets an existing web app.
  14411. func (r *WebappsService) Get(enterpriseId string, webAppId string) *WebappsGetCall {
  14412. c := &WebappsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14413. c.enterpriseId = enterpriseId
  14414. c.webAppId = webAppId
  14415. return c
  14416. }
  14417. // Fields allows partial responses to be retrieved. See
  14418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14419. // for more information.
  14420. func (c *WebappsGetCall) Fields(s ...googleapi.Field) *WebappsGetCall {
  14421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14422. return c
  14423. }
  14424. // IfNoneMatch sets the optional parameter which makes the operation
  14425. // fail if the object's ETag matches the given value. This is useful for
  14426. // getting updates only after the object has changed since the last
  14427. // request. Use googleapi.IsNotModified to check whether the response
  14428. // error from Do is the result of In-None-Match.
  14429. func (c *WebappsGetCall) IfNoneMatch(entityTag string) *WebappsGetCall {
  14430. c.ifNoneMatch_ = entityTag
  14431. return c
  14432. }
  14433. // Context sets the context to be used in this call's Do method. Any
  14434. // pending HTTP request will be aborted if the provided context is
  14435. // canceled.
  14436. func (c *WebappsGetCall) Context(ctx context.Context) *WebappsGetCall {
  14437. c.ctx_ = ctx
  14438. return c
  14439. }
  14440. // Header returns an http.Header that can be modified by the caller to
  14441. // add HTTP headers to the request.
  14442. func (c *WebappsGetCall) Header() http.Header {
  14443. if c.header_ == nil {
  14444. c.header_ = make(http.Header)
  14445. }
  14446. return c.header_
  14447. }
  14448. func (c *WebappsGetCall) doRequest(alt string) (*http.Response, error) {
  14449. reqHeaders := make(http.Header)
  14450. for k, v := range c.header_ {
  14451. reqHeaders[k] = v
  14452. }
  14453. reqHeaders.Set("User-Agent", c.s.userAgent())
  14454. if c.ifNoneMatch_ != "" {
  14455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14456. }
  14457. var body io.Reader = nil
  14458. c.urlParams_.Set("alt", alt)
  14459. c.urlParams_.Set("prettyPrint", "false")
  14460. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}")
  14461. urls += "?" + c.urlParams_.Encode()
  14462. req, err := http.NewRequest("GET", urls, body)
  14463. if err != nil {
  14464. return nil, err
  14465. }
  14466. req.Header = reqHeaders
  14467. googleapi.Expand(req.URL, map[string]string{
  14468. "enterpriseId": c.enterpriseId,
  14469. "webAppId": c.webAppId,
  14470. })
  14471. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14472. }
  14473. // Do executes the "androidenterprise.webapps.get" call.
  14474. // Exactly one of *WebApp or error will be non-nil. Any non-2xx status
  14475. // code is an error. Response headers are in either
  14476. // *WebApp.ServerResponse.Header or (if a response was returned at all)
  14477. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14478. // check whether the returned error was because http.StatusNotModified
  14479. // was returned.
  14480. func (c *WebappsGetCall) Do(opts ...googleapi.CallOption) (*WebApp, error) {
  14481. gensupport.SetOptions(c.urlParams_, opts...)
  14482. res, err := c.doRequest("json")
  14483. if res != nil && res.StatusCode == http.StatusNotModified {
  14484. if res.Body != nil {
  14485. res.Body.Close()
  14486. }
  14487. return nil, &googleapi.Error{
  14488. Code: res.StatusCode,
  14489. Header: res.Header,
  14490. }
  14491. }
  14492. if err != nil {
  14493. return nil, err
  14494. }
  14495. defer googleapi.CloseBody(res)
  14496. if err := googleapi.CheckResponse(res); err != nil {
  14497. return nil, err
  14498. }
  14499. ret := &WebApp{
  14500. ServerResponse: googleapi.ServerResponse{
  14501. Header: res.Header,
  14502. HTTPStatusCode: res.StatusCode,
  14503. },
  14504. }
  14505. target := &ret
  14506. if err := gensupport.DecodeResponse(target, res); err != nil {
  14507. return nil, err
  14508. }
  14509. return ret, nil
  14510. // {
  14511. // "description": "Gets an existing web app.",
  14512. // "httpMethod": "GET",
  14513. // "id": "androidenterprise.webapps.get",
  14514. // "parameterOrder": [
  14515. // "enterpriseId",
  14516. // "webAppId"
  14517. // ],
  14518. // "parameters": {
  14519. // "enterpriseId": {
  14520. // "description": "The ID of the enterprise.",
  14521. // "location": "path",
  14522. // "required": true,
  14523. // "type": "string"
  14524. // },
  14525. // "webAppId": {
  14526. // "description": "The ID of the web app.",
  14527. // "location": "path",
  14528. // "required": true,
  14529. // "type": "string"
  14530. // }
  14531. // },
  14532. // "path": "enterprises/{enterpriseId}/webApps/{webAppId}",
  14533. // "response": {
  14534. // "$ref": "WebApp"
  14535. // },
  14536. // "scopes": [
  14537. // "https://www.googleapis.com/auth/androidenterprise"
  14538. // ]
  14539. // }
  14540. }
  14541. // method id "androidenterprise.webapps.insert":
  14542. type WebappsInsertCall struct {
  14543. s *Service
  14544. enterpriseId string
  14545. webapp *WebApp
  14546. urlParams_ gensupport.URLParams
  14547. ctx_ context.Context
  14548. header_ http.Header
  14549. }
  14550. // Insert: Creates a new web app for the enterprise.
  14551. func (r *WebappsService) Insert(enterpriseId string, webapp *WebApp) *WebappsInsertCall {
  14552. c := &WebappsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14553. c.enterpriseId = enterpriseId
  14554. c.webapp = webapp
  14555. return c
  14556. }
  14557. // Fields allows partial responses to be retrieved. See
  14558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14559. // for more information.
  14560. func (c *WebappsInsertCall) Fields(s ...googleapi.Field) *WebappsInsertCall {
  14561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14562. return c
  14563. }
  14564. // Context sets the context to be used in this call's Do method. Any
  14565. // pending HTTP request will be aborted if the provided context is
  14566. // canceled.
  14567. func (c *WebappsInsertCall) Context(ctx context.Context) *WebappsInsertCall {
  14568. c.ctx_ = ctx
  14569. return c
  14570. }
  14571. // Header returns an http.Header that can be modified by the caller to
  14572. // add HTTP headers to the request.
  14573. func (c *WebappsInsertCall) Header() http.Header {
  14574. if c.header_ == nil {
  14575. c.header_ = make(http.Header)
  14576. }
  14577. return c.header_
  14578. }
  14579. func (c *WebappsInsertCall) doRequest(alt string) (*http.Response, error) {
  14580. reqHeaders := make(http.Header)
  14581. for k, v := range c.header_ {
  14582. reqHeaders[k] = v
  14583. }
  14584. reqHeaders.Set("User-Agent", c.s.userAgent())
  14585. var body io.Reader = nil
  14586. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp)
  14587. if err != nil {
  14588. return nil, err
  14589. }
  14590. reqHeaders.Set("Content-Type", "application/json")
  14591. c.urlParams_.Set("alt", alt)
  14592. c.urlParams_.Set("prettyPrint", "false")
  14593. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps")
  14594. urls += "?" + c.urlParams_.Encode()
  14595. req, err := http.NewRequest("POST", urls, body)
  14596. if err != nil {
  14597. return nil, err
  14598. }
  14599. req.Header = reqHeaders
  14600. googleapi.Expand(req.URL, map[string]string{
  14601. "enterpriseId": c.enterpriseId,
  14602. })
  14603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14604. }
  14605. // Do executes the "androidenterprise.webapps.insert" call.
  14606. // Exactly one of *WebApp or error will be non-nil. Any non-2xx status
  14607. // code is an error. Response headers are in either
  14608. // *WebApp.ServerResponse.Header or (if a response was returned at all)
  14609. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14610. // check whether the returned error was because http.StatusNotModified
  14611. // was returned.
  14612. func (c *WebappsInsertCall) Do(opts ...googleapi.CallOption) (*WebApp, error) {
  14613. gensupport.SetOptions(c.urlParams_, opts...)
  14614. res, err := c.doRequest("json")
  14615. if res != nil && res.StatusCode == http.StatusNotModified {
  14616. if res.Body != nil {
  14617. res.Body.Close()
  14618. }
  14619. return nil, &googleapi.Error{
  14620. Code: res.StatusCode,
  14621. Header: res.Header,
  14622. }
  14623. }
  14624. if err != nil {
  14625. return nil, err
  14626. }
  14627. defer googleapi.CloseBody(res)
  14628. if err := googleapi.CheckResponse(res); err != nil {
  14629. return nil, err
  14630. }
  14631. ret := &WebApp{
  14632. ServerResponse: googleapi.ServerResponse{
  14633. Header: res.Header,
  14634. HTTPStatusCode: res.StatusCode,
  14635. },
  14636. }
  14637. target := &ret
  14638. if err := gensupport.DecodeResponse(target, res); err != nil {
  14639. return nil, err
  14640. }
  14641. return ret, nil
  14642. // {
  14643. // "description": "Creates a new web app for the enterprise.",
  14644. // "httpMethod": "POST",
  14645. // "id": "androidenterprise.webapps.insert",
  14646. // "parameterOrder": [
  14647. // "enterpriseId"
  14648. // ],
  14649. // "parameters": {
  14650. // "enterpriseId": {
  14651. // "description": "The ID of the enterprise.",
  14652. // "location": "path",
  14653. // "required": true,
  14654. // "type": "string"
  14655. // }
  14656. // },
  14657. // "path": "enterprises/{enterpriseId}/webApps",
  14658. // "request": {
  14659. // "$ref": "WebApp"
  14660. // },
  14661. // "response": {
  14662. // "$ref": "WebApp"
  14663. // },
  14664. // "scopes": [
  14665. // "https://www.googleapis.com/auth/androidenterprise"
  14666. // ]
  14667. // }
  14668. }
  14669. // method id "androidenterprise.webapps.list":
  14670. type WebappsListCall struct {
  14671. s *Service
  14672. enterpriseId string
  14673. urlParams_ gensupport.URLParams
  14674. ifNoneMatch_ string
  14675. ctx_ context.Context
  14676. header_ http.Header
  14677. }
  14678. // List: Retrieves the details of all web apps for a given enterprise.
  14679. func (r *WebappsService) List(enterpriseId string) *WebappsListCall {
  14680. c := &WebappsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14681. c.enterpriseId = enterpriseId
  14682. return c
  14683. }
  14684. // Fields allows partial responses to be retrieved. See
  14685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14686. // for more information.
  14687. func (c *WebappsListCall) Fields(s ...googleapi.Field) *WebappsListCall {
  14688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14689. return c
  14690. }
  14691. // IfNoneMatch sets the optional parameter which makes the operation
  14692. // fail if the object's ETag matches the given value. This is useful for
  14693. // getting updates only after the object has changed since the last
  14694. // request. Use googleapi.IsNotModified to check whether the response
  14695. // error from Do is the result of In-None-Match.
  14696. func (c *WebappsListCall) IfNoneMatch(entityTag string) *WebappsListCall {
  14697. c.ifNoneMatch_ = entityTag
  14698. return c
  14699. }
  14700. // Context sets the context to be used in this call's Do method. Any
  14701. // pending HTTP request will be aborted if the provided context is
  14702. // canceled.
  14703. func (c *WebappsListCall) Context(ctx context.Context) *WebappsListCall {
  14704. c.ctx_ = ctx
  14705. return c
  14706. }
  14707. // Header returns an http.Header that can be modified by the caller to
  14708. // add HTTP headers to the request.
  14709. func (c *WebappsListCall) Header() http.Header {
  14710. if c.header_ == nil {
  14711. c.header_ = make(http.Header)
  14712. }
  14713. return c.header_
  14714. }
  14715. func (c *WebappsListCall) doRequest(alt string) (*http.Response, error) {
  14716. reqHeaders := make(http.Header)
  14717. for k, v := range c.header_ {
  14718. reqHeaders[k] = v
  14719. }
  14720. reqHeaders.Set("User-Agent", c.s.userAgent())
  14721. if c.ifNoneMatch_ != "" {
  14722. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14723. }
  14724. var body io.Reader = nil
  14725. c.urlParams_.Set("alt", alt)
  14726. c.urlParams_.Set("prettyPrint", "false")
  14727. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps")
  14728. urls += "?" + c.urlParams_.Encode()
  14729. req, err := http.NewRequest("GET", urls, body)
  14730. if err != nil {
  14731. return nil, err
  14732. }
  14733. req.Header = reqHeaders
  14734. googleapi.Expand(req.URL, map[string]string{
  14735. "enterpriseId": c.enterpriseId,
  14736. })
  14737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14738. }
  14739. // Do executes the "androidenterprise.webapps.list" call.
  14740. // Exactly one of *WebAppsListResponse or error will be non-nil. Any
  14741. // non-2xx status code is an error. Response headers are in either
  14742. // *WebAppsListResponse.ServerResponse.Header or (if a response was
  14743. // returned at all) in error.(*googleapi.Error).Header. Use
  14744. // googleapi.IsNotModified to check whether the returned error was
  14745. // because http.StatusNotModified was returned.
  14746. func (c *WebappsListCall) Do(opts ...googleapi.CallOption) (*WebAppsListResponse, error) {
  14747. gensupport.SetOptions(c.urlParams_, opts...)
  14748. res, err := c.doRequest("json")
  14749. if res != nil && res.StatusCode == http.StatusNotModified {
  14750. if res.Body != nil {
  14751. res.Body.Close()
  14752. }
  14753. return nil, &googleapi.Error{
  14754. Code: res.StatusCode,
  14755. Header: res.Header,
  14756. }
  14757. }
  14758. if err != nil {
  14759. return nil, err
  14760. }
  14761. defer googleapi.CloseBody(res)
  14762. if err := googleapi.CheckResponse(res); err != nil {
  14763. return nil, err
  14764. }
  14765. ret := &WebAppsListResponse{
  14766. ServerResponse: googleapi.ServerResponse{
  14767. Header: res.Header,
  14768. HTTPStatusCode: res.StatusCode,
  14769. },
  14770. }
  14771. target := &ret
  14772. if err := gensupport.DecodeResponse(target, res); err != nil {
  14773. return nil, err
  14774. }
  14775. return ret, nil
  14776. // {
  14777. // "description": "Retrieves the details of all web apps for a given enterprise.",
  14778. // "httpMethod": "GET",
  14779. // "id": "androidenterprise.webapps.list",
  14780. // "parameterOrder": [
  14781. // "enterpriseId"
  14782. // ],
  14783. // "parameters": {
  14784. // "enterpriseId": {
  14785. // "description": "The ID of the enterprise.",
  14786. // "location": "path",
  14787. // "required": true,
  14788. // "type": "string"
  14789. // }
  14790. // },
  14791. // "path": "enterprises/{enterpriseId}/webApps",
  14792. // "response": {
  14793. // "$ref": "WebAppsListResponse"
  14794. // },
  14795. // "scopes": [
  14796. // "https://www.googleapis.com/auth/androidenterprise"
  14797. // ]
  14798. // }
  14799. }
  14800. // method id "androidenterprise.webapps.patch":
  14801. type WebappsPatchCall struct {
  14802. s *Service
  14803. enterpriseId string
  14804. webAppId string
  14805. webapp *WebApp
  14806. urlParams_ gensupport.URLParams
  14807. ctx_ context.Context
  14808. header_ http.Header
  14809. }
  14810. // Patch: Updates an existing web app. This method supports patch
  14811. // semantics.
  14812. func (r *WebappsService) Patch(enterpriseId string, webAppId string, webapp *WebApp) *WebappsPatchCall {
  14813. c := &WebappsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14814. c.enterpriseId = enterpriseId
  14815. c.webAppId = webAppId
  14816. c.webapp = webapp
  14817. return c
  14818. }
  14819. // Fields allows partial responses to be retrieved. See
  14820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14821. // for more information.
  14822. func (c *WebappsPatchCall) Fields(s ...googleapi.Field) *WebappsPatchCall {
  14823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14824. return c
  14825. }
  14826. // Context sets the context to be used in this call's Do method. Any
  14827. // pending HTTP request will be aborted if the provided context is
  14828. // canceled.
  14829. func (c *WebappsPatchCall) Context(ctx context.Context) *WebappsPatchCall {
  14830. c.ctx_ = ctx
  14831. return c
  14832. }
  14833. // Header returns an http.Header that can be modified by the caller to
  14834. // add HTTP headers to the request.
  14835. func (c *WebappsPatchCall) Header() http.Header {
  14836. if c.header_ == nil {
  14837. c.header_ = make(http.Header)
  14838. }
  14839. return c.header_
  14840. }
  14841. func (c *WebappsPatchCall) doRequest(alt string) (*http.Response, error) {
  14842. reqHeaders := make(http.Header)
  14843. for k, v := range c.header_ {
  14844. reqHeaders[k] = v
  14845. }
  14846. reqHeaders.Set("User-Agent", c.s.userAgent())
  14847. var body io.Reader = nil
  14848. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp)
  14849. if err != nil {
  14850. return nil, err
  14851. }
  14852. reqHeaders.Set("Content-Type", "application/json")
  14853. c.urlParams_.Set("alt", alt)
  14854. c.urlParams_.Set("prettyPrint", "false")
  14855. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}")
  14856. urls += "?" + c.urlParams_.Encode()
  14857. req, err := http.NewRequest("PATCH", urls, body)
  14858. if err != nil {
  14859. return nil, err
  14860. }
  14861. req.Header = reqHeaders
  14862. googleapi.Expand(req.URL, map[string]string{
  14863. "enterpriseId": c.enterpriseId,
  14864. "webAppId": c.webAppId,
  14865. })
  14866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14867. }
  14868. // Do executes the "androidenterprise.webapps.patch" call.
  14869. // Exactly one of *WebApp or error will be non-nil. Any non-2xx status
  14870. // code is an error. Response headers are in either
  14871. // *WebApp.ServerResponse.Header or (if a response was returned at all)
  14872. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14873. // check whether the returned error was because http.StatusNotModified
  14874. // was returned.
  14875. func (c *WebappsPatchCall) Do(opts ...googleapi.CallOption) (*WebApp, error) {
  14876. gensupport.SetOptions(c.urlParams_, opts...)
  14877. res, err := c.doRequest("json")
  14878. if res != nil && res.StatusCode == http.StatusNotModified {
  14879. if res.Body != nil {
  14880. res.Body.Close()
  14881. }
  14882. return nil, &googleapi.Error{
  14883. Code: res.StatusCode,
  14884. Header: res.Header,
  14885. }
  14886. }
  14887. if err != nil {
  14888. return nil, err
  14889. }
  14890. defer googleapi.CloseBody(res)
  14891. if err := googleapi.CheckResponse(res); err != nil {
  14892. return nil, err
  14893. }
  14894. ret := &WebApp{
  14895. ServerResponse: googleapi.ServerResponse{
  14896. Header: res.Header,
  14897. HTTPStatusCode: res.StatusCode,
  14898. },
  14899. }
  14900. target := &ret
  14901. if err := gensupport.DecodeResponse(target, res); err != nil {
  14902. return nil, err
  14903. }
  14904. return ret, nil
  14905. // {
  14906. // "description": "Updates an existing web app. This method supports patch semantics.",
  14907. // "httpMethod": "PATCH",
  14908. // "id": "androidenterprise.webapps.patch",
  14909. // "parameterOrder": [
  14910. // "enterpriseId",
  14911. // "webAppId"
  14912. // ],
  14913. // "parameters": {
  14914. // "enterpriseId": {
  14915. // "description": "The ID of the enterprise.",
  14916. // "location": "path",
  14917. // "required": true,
  14918. // "type": "string"
  14919. // },
  14920. // "webAppId": {
  14921. // "description": "The ID of the web app.",
  14922. // "location": "path",
  14923. // "required": true,
  14924. // "type": "string"
  14925. // }
  14926. // },
  14927. // "path": "enterprises/{enterpriseId}/webApps/{webAppId}",
  14928. // "request": {
  14929. // "$ref": "WebApp"
  14930. // },
  14931. // "response": {
  14932. // "$ref": "WebApp"
  14933. // },
  14934. // "scopes": [
  14935. // "https://www.googleapis.com/auth/androidenterprise"
  14936. // ]
  14937. // }
  14938. }
  14939. // method id "androidenterprise.webapps.update":
  14940. type WebappsUpdateCall struct {
  14941. s *Service
  14942. enterpriseId string
  14943. webAppId string
  14944. webapp *WebApp
  14945. urlParams_ gensupport.URLParams
  14946. ctx_ context.Context
  14947. header_ http.Header
  14948. }
  14949. // Update: Updates an existing web app.
  14950. func (r *WebappsService) Update(enterpriseId string, webAppId string, webapp *WebApp) *WebappsUpdateCall {
  14951. c := &WebappsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14952. c.enterpriseId = enterpriseId
  14953. c.webAppId = webAppId
  14954. c.webapp = webapp
  14955. return c
  14956. }
  14957. // Fields allows partial responses to be retrieved. See
  14958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14959. // for more information.
  14960. func (c *WebappsUpdateCall) Fields(s ...googleapi.Field) *WebappsUpdateCall {
  14961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14962. return c
  14963. }
  14964. // Context sets the context to be used in this call's Do method. Any
  14965. // pending HTTP request will be aborted if the provided context is
  14966. // canceled.
  14967. func (c *WebappsUpdateCall) Context(ctx context.Context) *WebappsUpdateCall {
  14968. c.ctx_ = ctx
  14969. return c
  14970. }
  14971. // Header returns an http.Header that can be modified by the caller to
  14972. // add HTTP headers to the request.
  14973. func (c *WebappsUpdateCall) Header() http.Header {
  14974. if c.header_ == nil {
  14975. c.header_ = make(http.Header)
  14976. }
  14977. return c.header_
  14978. }
  14979. func (c *WebappsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14980. reqHeaders := make(http.Header)
  14981. for k, v := range c.header_ {
  14982. reqHeaders[k] = v
  14983. }
  14984. reqHeaders.Set("User-Agent", c.s.userAgent())
  14985. var body io.Reader = nil
  14986. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webapp)
  14987. if err != nil {
  14988. return nil, err
  14989. }
  14990. reqHeaders.Set("Content-Type", "application/json")
  14991. c.urlParams_.Set("alt", alt)
  14992. c.urlParams_.Set("prettyPrint", "false")
  14993. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/webApps/{webAppId}")
  14994. urls += "?" + c.urlParams_.Encode()
  14995. req, err := http.NewRequest("PUT", urls, body)
  14996. if err != nil {
  14997. return nil, err
  14998. }
  14999. req.Header = reqHeaders
  15000. googleapi.Expand(req.URL, map[string]string{
  15001. "enterpriseId": c.enterpriseId,
  15002. "webAppId": c.webAppId,
  15003. })
  15004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15005. }
  15006. // Do executes the "androidenterprise.webapps.update" call.
  15007. // Exactly one of *WebApp or error will be non-nil. Any non-2xx status
  15008. // code is an error. Response headers are in either
  15009. // *WebApp.ServerResponse.Header or (if a response was returned at all)
  15010. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15011. // check whether the returned error was because http.StatusNotModified
  15012. // was returned.
  15013. func (c *WebappsUpdateCall) Do(opts ...googleapi.CallOption) (*WebApp, error) {
  15014. gensupport.SetOptions(c.urlParams_, opts...)
  15015. res, err := c.doRequest("json")
  15016. if res != nil && res.StatusCode == http.StatusNotModified {
  15017. if res.Body != nil {
  15018. res.Body.Close()
  15019. }
  15020. return nil, &googleapi.Error{
  15021. Code: res.StatusCode,
  15022. Header: res.Header,
  15023. }
  15024. }
  15025. if err != nil {
  15026. return nil, err
  15027. }
  15028. defer googleapi.CloseBody(res)
  15029. if err := googleapi.CheckResponse(res); err != nil {
  15030. return nil, err
  15031. }
  15032. ret := &WebApp{
  15033. ServerResponse: googleapi.ServerResponse{
  15034. Header: res.Header,
  15035. HTTPStatusCode: res.StatusCode,
  15036. },
  15037. }
  15038. target := &ret
  15039. if err := gensupport.DecodeResponse(target, res); err != nil {
  15040. return nil, err
  15041. }
  15042. return ret, nil
  15043. // {
  15044. // "description": "Updates an existing web app.",
  15045. // "httpMethod": "PUT",
  15046. // "id": "androidenterprise.webapps.update",
  15047. // "parameterOrder": [
  15048. // "enterpriseId",
  15049. // "webAppId"
  15050. // ],
  15051. // "parameters": {
  15052. // "enterpriseId": {
  15053. // "description": "The ID of the enterprise.",
  15054. // "location": "path",
  15055. // "required": true,
  15056. // "type": "string"
  15057. // },
  15058. // "webAppId": {
  15059. // "description": "The ID of the web app.",
  15060. // "location": "path",
  15061. // "required": true,
  15062. // "type": "string"
  15063. // }
  15064. // },
  15065. // "path": "enterprises/{enterpriseId}/webApps/{webAppId}",
  15066. // "request": {
  15067. // "$ref": "WebApp"
  15068. // },
  15069. // "response": {
  15070. // "$ref": "WebApp"
  15071. // },
  15072. // "scopes": [
  15073. // "https://www.googleapis.com/auth/androidenterprise"
  15074. // ]
  15075. // }
  15076. }