You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15269 lines
531 KiB

  1. // Package androidenterprise provides access to the Google Play EMM API.
  2. //
  3. // See https://developers.google.com/android/work/play/emm-api
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/androidenterprise/v1"
  8. // ...
  9. // androidenterpriseService, err := androidenterprise.New(oauthHttpClient)
  10. package androidenterprise // import "google.golang.org/api/androidenterprise/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "androidenterprise:v1"
  41. const apiName = "androidenterprise"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/androidenterprise/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage corporate Android devices
  47. AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Devices = NewDevicesService(s)
  55. s.Enterprises = NewEnterprisesService(s)
  56. s.Entitlements = NewEntitlementsService(s)
  57. s.Grouplicenses = NewGrouplicensesService(s)
  58. s.Grouplicenseusers = NewGrouplicenseusersService(s)
  59. s.Installs = NewInstallsService(s)
  60. s.Managedconfigurationsfordevice = NewManagedconfigurationsfordeviceService(s)
  61. s.Managedconfigurationsforuser = NewManagedconfigurationsforuserService(s)
  62. s.Managedconfigurationssettings = NewManagedconfigurationssettingsService(s)
  63. s.Permissions = NewPermissionsService(s)
  64. s.Products = NewProductsService(s)
  65. s.Serviceaccountkeys = NewServiceaccountkeysService(s)
  66. s.Storelayoutclusters = NewStorelayoutclustersService(s)
  67. s.Storelayoutpages = NewStorelayoutpagesService(s)
  68. s.Users = NewUsersService(s)
  69. return s, nil
  70. }
  71. type Service struct {
  72. client *http.Client
  73. BasePath string // API endpoint base URL
  74. UserAgent string // optional additional User-Agent fragment
  75. Devices *DevicesService
  76. Enterprises *EnterprisesService
  77. Entitlements *EntitlementsService
  78. Grouplicenses *GrouplicensesService
  79. Grouplicenseusers *GrouplicenseusersService
  80. Installs *InstallsService
  81. Managedconfigurationsfordevice *ManagedconfigurationsfordeviceService
  82. Managedconfigurationsforuser *ManagedconfigurationsforuserService
  83. Managedconfigurationssettings *ManagedconfigurationssettingsService
  84. Permissions *PermissionsService
  85. Products *ProductsService
  86. Serviceaccountkeys *ServiceaccountkeysService
  87. Storelayoutclusters *StorelayoutclustersService
  88. Storelayoutpages *StorelayoutpagesService
  89. Users *UsersService
  90. }
  91. func (s *Service) userAgent() string {
  92. if s.UserAgent == "" {
  93. return googleapi.UserAgent
  94. }
  95. return googleapi.UserAgent + " " + s.UserAgent
  96. }
  97. func NewDevicesService(s *Service) *DevicesService {
  98. rs := &DevicesService{s: s}
  99. return rs
  100. }
  101. type DevicesService struct {
  102. s *Service
  103. }
  104. func NewEnterprisesService(s *Service) *EnterprisesService {
  105. rs := &EnterprisesService{s: s}
  106. return rs
  107. }
  108. type EnterprisesService struct {
  109. s *Service
  110. }
  111. func NewEntitlementsService(s *Service) *EntitlementsService {
  112. rs := &EntitlementsService{s: s}
  113. return rs
  114. }
  115. type EntitlementsService struct {
  116. s *Service
  117. }
  118. func NewGrouplicensesService(s *Service) *GrouplicensesService {
  119. rs := &GrouplicensesService{s: s}
  120. return rs
  121. }
  122. type GrouplicensesService struct {
  123. s *Service
  124. }
  125. func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService {
  126. rs := &GrouplicenseusersService{s: s}
  127. return rs
  128. }
  129. type GrouplicenseusersService struct {
  130. s *Service
  131. }
  132. func NewInstallsService(s *Service) *InstallsService {
  133. rs := &InstallsService{s: s}
  134. return rs
  135. }
  136. type InstallsService struct {
  137. s *Service
  138. }
  139. func NewManagedconfigurationsfordeviceService(s *Service) *ManagedconfigurationsfordeviceService {
  140. rs := &ManagedconfigurationsfordeviceService{s: s}
  141. return rs
  142. }
  143. type ManagedconfigurationsfordeviceService struct {
  144. s *Service
  145. }
  146. func NewManagedconfigurationsforuserService(s *Service) *ManagedconfigurationsforuserService {
  147. rs := &ManagedconfigurationsforuserService{s: s}
  148. return rs
  149. }
  150. type ManagedconfigurationsforuserService struct {
  151. s *Service
  152. }
  153. func NewManagedconfigurationssettingsService(s *Service) *ManagedconfigurationssettingsService {
  154. rs := &ManagedconfigurationssettingsService{s: s}
  155. return rs
  156. }
  157. type ManagedconfigurationssettingsService struct {
  158. s *Service
  159. }
  160. func NewPermissionsService(s *Service) *PermissionsService {
  161. rs := &PermissionsService{s: s}
  162. return rs
  163. }
  164. type PermissionsService struct {
  165. s *Service
  166. }
  167. func NewProductsService(s *Service) *ProductsService {
  168. rs := &ProductsService{s: s}
  169. return rs
  170. }
  171. type ProductsService struct {
  172. s *Service
  173. }
  174. func NewServiceaccountkeysService(s *Service) *ServiceaccountkeysService {
  175. rs := &ServiceaccountkeysService{s: s}
  176. return rs
  177. }
  178. type ServiceaccountkeysService struct {
  179. s *Service
  180. }
  181. func NewStorelayoutclustersService(s *Service) *StorelayoutclustersService {
  182. rs := &StorelayoutclustersService{s: s}
  183. return rs
  184. }
  185. type StorelayoutclustersService struct {
  186. s *Service
  187. }
  188. func NewStorelayoutpagesService(s *Service) *StorelayoutpagesService {
  189. rs := &StorelayoutpagesService{s: s}
  190. return rs
  191. }
  192. type StorelayoutpagesService struct {
  193. s *Service
  194. }
  195. func NewUsersService(s *Service) *UsersService {
  196. rs := &UsersService{s: s}
  197. return rs
  198. }
  199. type UsersService struct {
  200. s *Service
  201. }
  202. // Administrator: This represents an enterprise admin who can manage the
  203. // enterprise in the managed Google Play store.
  204. type Administrator struct {
  205. // Email: The admin's email address.
  206. Email string `json:"email,omitempty"`
  207. // ForceSendFields is a list of field names (e.g. "Email") to
  208. // unconditionally include in API requests. By default, fields with
  209. // empty values are omitted from API requests. However, any non-pointer,
  210. // non-interface field appearing in ForceSendFields will be sent to the
  211. // server regardless of whether the field is empty or not. This may be
  212. // used to include empty fields in Patch requests.
  213. ForceSendFields []string `json:"-"`
  214. // NullFields is a list of field names (e.g. "Email") to include in API
  215. // requests with the JSON null value. By default, fields with empty
  216. // values are omitted from API requests. However, any field with an
  217. // empty value appearing in NullFields will be sent to the server as
  218. // null. It is an error if a field in this list has a non-empty value.
  219. // This may be used to include null fields in Patch requests.
  220. NullFields []string `json:"-"`
  221. }
  222. func (s *Administrator) MarshalJSON() ([]byte, error) {
  223. type NoMethod Administrator
  224. raw := NoMethod(*s)
  225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  226. }
  227. // AdministratorWebToken: A token authorizing an admin to access an
  228. // iframe.
  229. type AdministratorWebToken struct {
  230. // Kind: Identifies what kind of resource this is. Value: the fixed
  231. // string "androidenterprise#administratorWebToken".
  232. Kind string `json:"kind,omitempty"`
  233. // Token: An opaque token to be passed to the Play front-end to generate
  234. // an iframe.
  235. Token string `json:"token,omitempty"`
  236. // ServerResponse contains the HTTP response code and headers from the
  237. // server.
  238. googleapi.ServerResponse `json:"-"`
  239. // ForceSendFields is a list of field names (e.g. "Kind") to
  240. // unconditionally include in API requests. By default, fields with
  241. // empty values are omitted from API requests. However, any non-pointer,
  242. // non-interface field appearing in ForceSendFields will be sent to the
  243. // server regardless of whether the field is empty or not. This may be
  244. // used to include empty fields in Patch requests.
  245. ForceSendFields []string `json:"-"`
  246. // NullFields is a list of field names (e.g. "Kind") to include in API
  247. // requests with the JSON null value. By default, fields with empty
  248. // values are omitted from API requests. However, any field with an
  249. // empty value appearing in NullFields will be sent to the server as
  250. // null. It is an error if a field in this list has a non-empty value.
  251. // This may be used to include null fields in Patch requests.
  252. NullFields []string `json:"-"`
  253. }
  254. func (s *AdministratorWebToken) MarshalJSON() ([]byte, error) {
  255. type NoMethod AdministratorWebToken
  256. raw := NoMethod(*s)
  257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  258. }
  259. // AdministratorWebTokenSpec: Specification for a token used to generate
  260. // iframes. The token specifies what data the admin is allowed to modify
  261. // and the URI the iframe is allowed to communiate with.
  262. type AdministratorWebTokenSpec struct {
  263. // Kind: Identifies what kind of resource this is. Value: the fixed
  264. // string "androidenterprise#administratorWebTokenSpec".
  265. Kind string `json:"kind,omitempty"`
  266. // Parent: The URI of the parent frame hosting the iframe. To prevent
  267. // XSS, the iframe may not be hosted at other URIs. This URI must be
  268. // https.
  269. Parent string `json:"parent,omitempty"`
  270. // Permission: The list of permissions the admin is granted within the
  271. // iframe. The admin will only be allowed to view an iframe if they have
  272. // all of the permissions associated with it. The only valid value is
  273. // "approveApps" that will allow the admin to access the iframe in
  274. // "approve" mode.
  275. Permission []string `json:"permission,omitempty"`
  276. // ForceSendFields is a list of field names (e.g. "Kind") to
  277. // unconditionally include in API requests. By default, fields with
  278. // empty values are omitted from API requests. However, any non-pointer,
  279. // non-interface field appearing in ForceSendFields will be sent to the
  280. // server regardless of whether the field is empty or not. This may be
  281. // used to include empty fields in Patch requests.
  282. ForceSendFields []string `json:"-"`
  283. // NullFields is a list of field names (e.g. "Kind") to include in API
  284. // requests with the JSON null value. By default, fields with empty
  285. // values are omitted from API requests. However, any field with an
  286. // empty value appearing in NullFields will be sent to the server as
  287. // null. It is an error if a field in this list has a non-empty value.
  288. // This may be used to include null fields in Patch requests.
  289. NullFields []string `json:"-"`
  290. }
  291. func (s *AdministratorWebTokenSpec) MarshalJSON() ([]byte, error) {
  292. type NoMethod AdministratorWebTokenSpec
  293. raw := NoMethod(*s)
  294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  295. }
  296. // AndroidDevicePolicyConfig: Deprecated and unused.
  297. type AndroidDevicePolicyConfig struct {
  298. // Kind: Identifies what kind of resource this is. Value: the fixed
  299. // string "androidenterprise#androidDevicePolicyConfig".
  300. Kind string `json:"kind,omitempty"`
  301. // State: Deprecated and unused.
  302. State string `json:"state,omitempty"`
  303. // ServerResponse contains the HTTP response code and headers from the
  304. // server.
  305. googleapi.ServerResponse `json:"-"`
  306. // ForceSendFields is a list of field names (e.g. "Kind") to
  307. // unconditionally include in API requests. By default, fields with
  308. // empty values are omitted from API requests. However, any non-pointer,
  309. // non-interface field appearing in ForceSendFields will be sent to the
  310. // server regardless of whether the field is empty or not. This may be
  311. // used to include empty fields in Patch requests.
  312. ForceSendFields []string `json:"-"`
  313. // NullFields is a list of field names (e.g. "Kind") to include in API
  314. // requests with the JSON null value. By default, fields with empty
  315. // values are omitted from API requests. However, any field with an
  316. // empty value appearing in NullFields will be sent to the server as
  317. // null. It is an error if a field in this list has a non-empty value.
  318. // This may be used to include null fields in Patch requests.
  319. NullFields []string `json:"-"`
  320. }
  321. func (s *AndroidDevicePolicyConfig) MarshalJSON() ([]byte, error) {
  322. type NoMethod AndroidDevicePolicyConfig
  323. raw := NoMethod(*s)
  324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  325. }
  326. // AppRestrictionsSchema: Represents the list of app restrictions
  327. // available to be pre-configured for the product.
  328. type AppRestrictionsSchema struct {
  329. // Kind: Identifies what kind of resource this is. Value: the fixed
  330. // string "androidenterprise#appRestrictionsSchema".
  331. Kind string `json:"kind,omitempty"`
  332. // Restrictions: The set of restrictions that make up this schema.
  333. Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"`
  334. // ServerResponse contains the HTTP response code and headers from the
  335. // server.
  336. googleapi.ServerResponse `json:"-"`
  337. // ForceSendFields is a list of field names (e.g. "Kind") to
  338. // unconditionally include in API requests. By default, fields with
  339. // empty values are omitted from API requests. However, any non-pointer,
  340. // non-interface field appearing in ForceSendFields will be sent to the
  341. // server regardless of whether the field is empty or not. This may be
  342. // used to include empty fields in Patch requests.
  343. ForceSendFields []string `json:"-"`
  344. // NullFields is a list of field names (e.g. "Kind") to include in API
  345. // requests with the JSON null value. By default, fields with empty
  346. // values are omitted from API requests. However, any field with an
  347. // empty value appearing in NullFields will be sent to the server as
  348. // null. It is an error if a field in this list has a non-empty value.
  349. // This may be used to include null fields in Patch requests.
  350. NullFields []string `json:"-"`
  351. }
  352. func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) {
  353. type NoMethod AppRestrictionsSchema
  354. raw := NoMethod(*s)
  355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  356. }
  357. // AppRestrictionsSchemaChangeEvent: An event generated when a new app
  358. // version is uploaded to Google Play and its app restrictions schema
  359. // changed. To fetch the app restrictions schema for an app, use
  360. // Products.getAppRestrictionsSchema on the EMM API.
  361. type AppRestrictionsSchemaChangeEvent struct {
  362. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  363. // for which the app restriction schema changed. This field will always
  364. // be present.
  365. ProductId string `json:"productId,omitempty"`
  366. // ForceSendFields is a list of field names (e.g. "ProductId") to
  367. // unconditionally include in API requests. By default, fields with
  368. // empty values are omitted from API requests. However, any non-pointer,
  369. // non-interface field appearing in ForceSendFields will be sent to the
  370. // server regardless of whether the field is empty or not. This may be
  371. // used to include empty fields in Patch requests.
  372. ForceSendFields []string `json:"-"`
  373. // NullFields is a list of field names (e.g. "ProductId") to include in
  374. // API requests with the JSON null value. By default, fields with empty
  375. // values are omitted from API requests. However, any field with an
  376. // empty value appearing in NullFields will be sent to the server as
  377. // null. It is an error if a field in this list has a non-empty value.
  378. // This may be used to include null fields in Patch requests.
  379. NullFields []string `json:"-"`
  380. }
  381. func (s *AppRestrictionsSchemaChangeEvent) MarshalJSON() ([]byte, error) {
  382. type NoMethod AppRestrictionsSchemaChangeEvent
  383. raw := NoMethod(*s)
  384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  385. }
  386. // AppRestrictionsSchemaRestriction: A restriction in the App
  387. // Restriction Schema represents a piece of configuration that may be
  388. // pre-applied.
  389. type AppRestrictionsSchemaRestriction struct {
  390. // DefaultValue: The default value of the restriction. bundle and
  391. // bundleArray restrictions never have a default value.
  392. DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"`
  393. // Description: A longer description of the restriction, giving more
  394. // detail of what it affects.
  395. Description string `json:"description,omitempty"`
  396. // Entry: For choice or multiselect restrictions, the list of possible
  397. // entries' human-readable names.
  398. Entry []string `json:"entry,omitempty"`
  399. // EntryValue: For choice or multiselect restrictions, the list of
  400. // possible entries' machine-readable values. These values should be
  401. // used in the configuration, either as a single string value for a
  402. // choice restriction or in a stringArray for a multiselect restriction.
  403. EntryValue []string `json:"entryValue,omitempty"`
  404. // Key: The unique key that the product uses to identify the
  405. // restriction, e.g. "com.google.android.gm.fieldname".
  406. Key string `json:"key,omitempty"`
  407. // NestedRestriction: For bundle or bundleArray restrictions, the list
  408. // of nested restrictions. A bundle restriction is always nested within
  409. // a bundleArray restriction, and a bundleArray restriction is at most
  410. // two levels deep.
  411. NestedRestriction []*AppRestrictionsSchemaRestriction `json:"nestedRestriction,omitempty"`
  412. // RestrictionType: The type of the restriction.
  413. RestrictionType string `json:"restrictionType,omitempty"`
  414. // Title: The name of the restriction.
  415. Title string `json:"title,omitempty"`
  416. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  417. // unconditionally include in API requests. By default, fields with
  418. // empty values are omitted from API requests. However, any non-pointer,
  419. // non-interface field appearing in ForceSendFields will be sent to the
  420. // server regardless of whether the field is empty or not. This may be
  421. // used to include empty fields in Patch requests.
  422. ForceSendFields []string `json:"-"`
  423. // NullFields is a list of field names (e.g. "DefaultValue") to include
  424. // in API requests with the JSON null value. By default, fields with
  425. // empty values are omitted from API requests. However, any field with
  426. // an empty value appearing in NullFields will be sent to the server as
  427. // null. It is an error if a field in this list has a non-empty value.
  428. // This may be used to include null fields in Patch requests.
  429. NullFields []string `json:"-"`
  430. }
  431. func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) {
  432. type NoMethod AppRestrictionsSchemaRestriction
  433. raw := NoMethod(*s)
  434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  435. }
  436. // AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for
  437. // the restriction.
  438. type AppRestrictionsSchemaRestrictionRestrictionValue struct {
  439. // Type: The type of the value being provided.
  440. Type string `json:"type,omitempty"`
  441. // ValueBool: The boolean value - this will only be present if type is
  442. // bool.
  443. ValueBool bool `json:"valueBool,omitempty"`
  444. // ValueInteger: The integer value - this will only be present if type
  445. // is integer.
  446. ValueInteger int64 `json:"valueInteger,omitempty"`
  447. // ValueMultiselect: The list of string values - this will only be
  448. // present if type is multiselect.
  449. ValueMultiselect []string `json:"valueMultiselect,omitempty"`
  450. // ValueString: The string value - this will be present for types
  451. // string, choice and hidden.
  452. ValueString string `json:"valueString,omitempty"`
  453. // ForceSendFields is a list of field names (e.g. "Type") to
  454. // unconditionally include in API requests. By default, fields with
  455. // empty values are omitted from API requests. However, any non-pointer,
  456. // non-interface field appearing in ForceSendFields will be sent to the
  457. // server regardless of whether the field is empty or not. This may be
  458. // used to include empty fields in Patch requests.
  459. ForceSendFields []string `json:"-"`
  460. // NullFields is a list of field names (e.g. "Type") to include in API
  461. // requests with the JSON null value. By default, fields with empty
  462. // values are omitted from API requests. However, any field with an
  463. // empty value appearing in NullFields will be sent to the server as
  464. // null. It is an error if a field in this list has a non-empty value.
  465. // This may be used to include null fields in Patch requests.
  466. NullFields []string `json:"-"`
  467. }
  468. func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) {
  469. type NoMethod AppRestrictionsSchemaRestrictionRestrictionValue
  470. raw := NoMethod(*s)
  471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  472. }
  473. // AppUpdateEvent: An event generated when a new version of an app is
  474. // uploaded to Google Play. Notifications are sent for new public
  475. // versions only: alpha, beta, or canary versions do not generate this
  476. // event. To fetch up-to-date version history for an app, use
  477. // Products.Get on the EMM API.
  478. type AppUpdateEvent struct {
  479. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  480. // that was updated. This field will always be present.
  481. ProductId string `json:"productId,omitempty"`
  482. // ForceSendFields is a list of field names (e.g. "ProductId") to
  483. // unconditionally include in API requests. By default, fields with
  484. // empty values are omitted from API requests. However, any non-pointer,
  485. // non-interface field appearing in ForceSendFields will be sent to the
  486. // server regardless of whether the field is empty or not. This may be
  487. // used to include empty fields in Patch requests.
  488. ForceSendFields []string `json:"-"`
  489. // NullFields is a list of field names (e.g. "ProductId") to include in
  490. // API requests with the JSON null value. By default, fields with empty
  491. // values are omitted from API requests. However, any field with an
  492. // empty value appearing in NullFields will be sent to the server as
  493. // null. It is an error if a field in this list has a non-empty value.
  494. // This may be used to include null fields in Patch requests.
  495. NullFields []string `json:"-"`
  496. }
  497. func (s *AppUpdateEvent) MarshalJSON() ([]byte, error) {
  498. type NoMethod AppUpdateEvent
  499. raw := NoMethod(*s)
  500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  501. }
  502. // AppVersion: This represents a single version of the app.
  503. type AppVersion struct {
  504. // Track: The track that this app was published in. For example if track
  505. // is "alpha", this is an alpha version of the app.
  506. Track string `json:"track,omitempty"`
  507. // VersionCode: Unique increasing identifier for the app version.
  508. VersionCode int64 `json:"versionCode,omitempty"`
  509. // VersionString: The string used in the Play store by the app developer
  510. // to identify the version. The string is not necessarily unique or
  511. // localized (for example, the string could be "1.4").
  512. VersionString string `json:"versionString,omitempty"`
  513. // ForceSendFields is a list of field names (e.g. "Track") to
  514. // unconditionally include in API requests. By default, fields with
  515. // empty values are omitted from API requests. However, any non-pointer,
  516. // non-interface field appearing in ForceSendFields will be sent to the
  517. // server regardless of whether the field is empty or not. This may be
  518. // used to include empty fields in Patch requests.
  519. ForceSendFields []string `json:"-"`
  520. // NullFields is a list of field names (e.g. "Track") to include in API
  521. // requests with the JSON null value. By default, fields with empty
  522. // values are omitted from API requests. However, any field with an
  523. // empty value appearing in NullFields will be sent to the server as
  524. // null. It is an error if a field in this list has a non-empty value.
  525. // This may be used to include null fields in Patch requests.
  526. NullFields []string `json:"-"`
  527. }
  528. func (s *AppVersion) MarshalJSON() ([]byte, error) {
  529. type NoMethod AppVersion
  530. raw := NoMethod(*s)
  531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  532. }
  533. // ApprovalUrlInfo: Information on an approval URL.
  534. type ApprovalUrlInfo struct {
  535. // ApprovalUrl: A URL that displays a product's permissions and that can
  536. // also be used to approve the product with the Products.approve call.
  537. ApprovalUrl string `json:"approvalUrl,omitempty"`
  538. // Kind: Identifies what kind of resource this is. Value: the fixed
  539. // string "androidenterprise#approvalUrlInfo".
  540. Kind string `json:"kind,omitempty"`
  541. // ForceSendFields is a list of field names (e.g. "ApprovalUrl") to
  542. // unconditionally include in API requests. By default, fields with
  543. // empty values are omitted from API requests. However, any non-pointer,
  544. // non-interface field appearing in ForceSendFields will be sent to the
  545. // server regardless of whether the field is empty or not. This may be
  546. // used to include empty fields in Patch requests.
  547. ForceSendFields []string `json:"-"`
  548. // NullFields is a list of field names (e.g. "ApprovalUrl") to include
  549. // in API requests with the JSON null value. By default, fields with
  550. // empty values are omitted from API requests. However, any field with
  551. // an empty value appearing in NullFields will be sent to the server as
  552. // null. It is an error if a field in this list has a non-empty value.
  553. // This may be used to include null fields in Patch requests.
  554. NullFields []string `json:"-"`
  555. }
  556. func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) {
  557. type NoMethod ApprovalUrlInfo
  558. raw := NoMethod(*s)
  559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  560. }
  561. // AuthenticationToken: An AuthenticationToken is used by the EMM's
  562. // device policy client on a device to provision the given EMM-managed
  563. // user on that device.
  564. type AuthenticationToken struct {
  565. // Kind: Identifies what kind of resource this is. Value: the fixed
  566. // string "androidenterprise#authenticationToken".
  567. Kind string `json:"kind,omitempty"`
  568. // Token: The authentication token to be passed to the device policy
  569. // client on the device where it can be used to provision the account
  570. // for which this token was generated.
  571. Token string `json:"token,omitempty"`
  572. // ServerResponse contains the HTTP response code and headers from the
  573. // server.
  574. googleapi.ServerResponse `json:"-"`
  575. // ForceSendFields is a list of field names (e.g. "Kind") to
  576. // unconditionally include in API requests. By default, fields with
  577. // empty values are omitted from API requests. However, any non-pointer,
  578. // non-interface field appearing in ForceSendFields will be sent to the
  579. // server regardless of whether the field is empty or not. This may be
  580. // used to include empty fields in Patch requests.
  581. ForceSendFields []string `json:"-"`
  582. // NullFields is a list of field names (e.g. "Kind") to include in API
  583. // requests with the JSON null value. By default, fields with empty
  584. // values are omitted from API requests. However, any field with an
  585. // empty value appearing in NullFields will be sent to the server as
  586. // null. It is an error if a field in this list has a non-empty value.
  587. // This may be used to include null fields in Patch requests.
  588. NullFields []string `json:"-"`
  589. }
  590. func (s *AuthenticationToken) MarshalJSON() ([]byte, error) {
  591. type NoMethod AuthenticationToken
  592. raw := NoMethod(*s)
  593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  594. }
  595. // ConfigurationVariables: A configuration variables resource contains
  596. // the managed configuration settings ID to be applied to a single user,
  597. // as well as the variable set that is attributed to the user. The
  598. // variable set will be used to replace placeholders in the managed
  599. // configuration settings.
  600. type ConfigurationVariables struct {
  601. // Kind: Identifies what kind of resource this is. Value: the fixed
  602. // string "androidenterprise#configurationVariables".
  603. Kind string `json:"kind,omitempty"`
  604. // McmId: The ID of the managed configurations settings.
  605. McmId string `json:"mcmId,omitempty"`
  606. // VariableSet: The variable set that is attributed to the user.
  607. VariableSet []*VariableSet `json:"variableSet,omitempty"`
  608. // ForceSendFields is a list of field names (e.g. "Kind") to
  609. // unconditionally include in API requests. By default, fields with
  610. // empty values are omitted from API requests. However, any non-pointer,
  611. // non-interface field appearing in ForceSendFields will be sent to the
  612. // server regardless of whether the field is empty or not. This may be
  613. // used to include empty fields in Patch requests.
  614. ForceSendFields []string `json:"-"`
  615. // NullFields is a list of field names (e.g. "Kind") to include in API
  616. // requests with the JSON null value. By default, fields with empty
  617. // values are omitted from API requests. However, any field with an
  618. // empty value appearing in NullFields will be sent to the server as
  619. // null. It is an error if a field in this list has a non-empty value.
  620. // This may be used to include null fields in Patch requests.
  621. NullFields []string `json:"-"`
  622. }
  623. func (s *ConfigurationVariables) MarshalJSON() ([]byte, error) {
  624. type NoMethod ConfigurationVariables
  625. raw := NoMethod(*s)
  626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  627. }
  628. // Device: A Devices resource represents a mobile device managed by the
  629. // EMM and belonging to a specific enterprise user.
  630. type Device struct {
  631. // AndroidId: The Google Play Services Android ID for the device encoded
  632. // as a lowercase hex string. For example, "123456789abcdef0".
  633. AndroidId string `json:"androidId,omitempty"`
  634. // Kind: Identifies what kind of resource this is. Value: the fixed
  635. // string "androidenterprise#device".
  636. Kind string `json:"kind,omitempty"`
  637. // ManagementType: Identifies the extent to which the device is
  638. // controlled by a managed Google Play EMM in various deployment
  639. // configurations.
  640. //
  641. // Possible values include:
  642. // - "managedDevice", a device that has the EMM's device policy
  643. // controller (DPC) as the device owner.
  644. // - "managedProfile", a device that has a profile managed by the DPC
  645. // (DPC is profile owner) in addition to a separate, personal profile
  646. // that is unavailable to the DPC.
  647. // - "containerApp", no longer used (deprecated).
  648. // - "unmanagedProfile", a device that has been allowed (by the domain's
  649. // admin, using the Admin Console to enable the privilege) to use
  650. // managed Google Play, but the profile is itself not owned by a DPC.
  651. ManagementType string `json:"managementType,omitempty"`
  652. // Policy: The policy enforced on the device.
  653. Policy *Policy `json:"policy,omitempty"`
  654. // ServerResponse contains the HTTP response code and headers from the
  655. // server.
  656. googleapi.ServerResponse `json:"-"`
  657. // ForceSendFields is a list of field names (e.g. "AndroidId") to
  658. // unconditionally include in API requests. By default, fields with
  659. // empty values are omitted from API requests. However, any non-pointer,
  660. // non-interface field appearing in ForceSendFields will be sent to the
  661. // server regardless of whether the field is empty or not. This may be
  662. // used to include empty fields in Patch requests.
  663. ForceSendFields []string `json:"-"`
  664. // NullFields is a list of field names (e.g. "AndroidId") to include in
  665. // API requests with the JSON null value. By default, fields with empty
  666. // values are omitted from API requests. However, any field with an
  667. // empty value appearing in NullFields will be sent to the server as
  668. // null. It is an error if a field in this list has a non-empty value.
  669. // This may be used to include null fields in Patch requests.
  670. NullFields []string `json:"-"`
  671. }
  672. func (s *Device) MarshalJSON() ([]byte, error) {
  673. type NoMethod Device
  674. raw := NoMethod(*s)
  675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  676. }
  677. // DeviceState: The state of a user's device, as accessed by the
  678. // getState and setState methods on device resources.
  679. type DeviceState struct {
  680. // AccountState: The state of the Google account on the device.
  681. // "enabled" indicates that the Google account on the device can be used
  682. // to access Google services (including Google Play), while "disabled"
  683. // means that it cannot. A new device is initially in the "disabled"
  684. // state.
  685. AccountState string `json:"accountState,omitempty"`
  686. // Kind: Identifies what kind of resource this is. Value: the fixed
  687. // string "androidenterprise#deviceState".
  688. Kind string `json:"kind,omitempty"`
  689. // ServerResponse contains the HTTP response code and headers from the
  690. // server.
  691. googleapi.ServerResponse `json:"-"`
  692. // ForceSendFields is a list of field names (e.g. "AccountState") to
  693. // unconditionally include in API requests. By default, fields with
  694. // empty values are omitted from API requests. However, any non-pointer,
  695. // non-interface field appearing in ForceSendFields will be sent to the
  696. // server regardless of whether the field is empty or not. This may be
  697. // used to include empty fields in Patch requests.
  698. ForceSendFields []string `json:"-"`
  699. // NullFields is a list of field names (e.g. "AccountState") to include
  700. // in API requests with the JSON null value. By default, fields with
  701. // empty values are omitted from API requests. However, any field with
  702. // an empty value appearing in NullFields will be sent to the server as
  703. // null. It is an error if a field in this list has a non-empty value.
  704. // This may be used to include null fields in Patch requests.
  705. NullFields []string `json:"-"`
  706. }
  707. func (s *DeviceState) MarshalJSON() ([]byte, error) {
  708. type NoMethod DeviceState
  709. raw := NoMethod(*s)
  710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  711. }
  712. // DevicesListResponse: The device resources for the user.
  713. type DevicesListResponse struct {
  714. // Device: A managed device.
  715. Device []*Device `json:"device,omitempty"`
  716. // Kind: Identifies what kind of resource this is. Value: the fixed
  717. // string "androidenterprise#devicesListResponse".
  718. Kind string `json:"kind,omitempty"`
  719. // ServerResponse contains the HTTP response code and headers from the
  720. // server.
  721. googleapi.ServerResponse `json:"-"`
  722. // ForceSendFields is a list of field names (e.g. "Device") to
  723. // unconditionally include in API requests. By default, fields with
  724. // empty values are omitted from API requests. However, any non-pointer,
  725. // non-interface field appearing in ForceSendFields will be sent to the
  726. // server regardless of whether the field is empty or not. This may be
  727. // used to include empty fields in Patch requests.
  728. ForceSendFields []string `json:"-"`
  729. // NullFields is a list of field names (e.g. "Device") to include in API
  730. // requests with the JSON null value. By default, fields with empty
  731. // values are omitted from API requests. However, any field with an
  732. // empty value appearing in NullFields will be sent to the server as
  733. // null. It is an error if a field in this list has a non-empty value.
  734. // This may be used to include null fields in Patch requests.
  735. NullFields []string `json:"-"`
  736. }
  737. func (s *DevicesListResponse) MarshalJSON() ([]byte, error) {
  738. type NoMethod DevicesListResponse
  739. raw := NoMethod(*s)
  740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  741. }
  742. // Enterprise: An Enterprises resource represents the binding between an
  743. // EMM and a specific organization. That binding can be instantiated in
  744. // one of two different ways using this API as follows:
  745. // - For Google managed domain customers, the process involves using
  746. // Enterprises.enroll and Enterprises.setAccount (in conjunction with
  747. // artifacts obtained from the Admin console and the Google API Console)
  748. // and submitted to the EMM through a more-or-less manual process.
  749. // - For managed Google Play Accounts customers, the process involves
  750. // using Enterprises.generateSignupUrl and Enterprises.completeSignup in
  751. // conjunction with the managed Google Play sign-up UI (Google-provided
  752. // mechanism) to create the binding without manual steps. As an EMM, you
  753. // can support either or both approaches in your EMM console. See Create
  754. // an Enterprise for details.
  755. type Enterprise struct {
  756. // Administrator: Admins of the enterprise. This is only supported for
  757. // enterprises created via the EMM-initiated flow.
  758. Administrator []*Administrator `json:"administrator,omitempty"`
  759. // Id: The unique ID for the enterprise.
  760. Id string `json:"id,omitempty"`
  761. // Kind: Identifies what kind of resource this is. Value: the fixed
  762. // string "androidenterprise#enterprise".
  763. Kind string `json:"kind,omitempty"`
  764. // Name: The name of the enterprise, for example, "Example, Inc".
  765. Name string `json:"name,omitempty"`
  766. // PrimaryDomain: The enterprise's primary domain, such as
  767. // "example.com".
  768. PrimaryDomain string `json:"primaryDomain,omitempty"`
  769. // ServerResponse contains the HTTP response code and headers from the
  770. // server.
  771. googleapi.ServerResponse `json:"-"`
  772. // ForceSendFields is a list of field names (e.g. "Administrator") to
  773. // unconditionally include in API requests. By default, fields with
  774. // empty values are omitted from API requests. However, any non-pointer,
  775. // non-interface field appearing in ForceSendFields will be sent to the
  776. // server regardless of whether the field is empty or not. This may be
  777. // used to include empty fields in Patch requests.
  778. ForceSendFields []string `json:"-"`
  779. // NullFields is a list of field names (e.g. "Administrator") to include
  780. // in API requests with the JSON null value. By default, fields with
  781. // empty values are omitted from API requests. However, any field with
  782. // an empty value appearing in NullFields will be sent to the server as
  783. // null. It is an error if a field in this list has a non-empty value.
  784. // This may be used to include null fields in Patch requests.
  785. NullFields []string `json:"-"`
  786. }
  787. func (s *Enterprise) MarshalJSON() ([]byte, error) {
  788. type NoMethod Enterprise
  789. raw := NoMethod(*s)
  790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  791. }
  792. // EnterpriseAccount: A service account that can be used to authenticate
  793. // as the enterprise to API calls that require such authentication.
  794. type EnterpriseAccount struct {
  795. // AccountEmail: The email address of the service account.
  796. AccountEmail string `json:"accountEmail,omitempty"`
  797. // Kind: Identifies what kind of resource this is. Value: the fixed
  798. // string "androidenterprise#enterpriseAccount".
  799. Kind string `json:"kind,omitempty"`
  800. // ServerResponse contains the HTTP response code and headers from the
  801. // server.
  802. googleapi.ServerResponse `json:"-"`
  803. // ForceSendFields is a list of field names (e.g. "AccountEmail") to
  804. // unconditionally include in API requests. By default, fields with
  805. // empty values are omitted from API requests. However, any non-pointer,
  806. // non-interface field appearing in ForceSendFields will be sent to the
  807. // server regardless of whether the field is empty or not. This may be
  808. // used to include empty fields in Patch requests.
  809. ForceSendFields []string `json:"-"`
  810. // NullFields is a list of field names (e.g. "AccountEmail") to include
  811. // in API requests with the JSON null value. By default, fields with
  812. // empty values are omitted from API requests. However, any field with
  813. // an empty value appearing in NullFields will be sent to the server as
  814. // null. It is an error if a field in this list has a non-empty value.
  815. // This may be used to include null fields in Patch requests.
  816. NullFields []string `json:"-"`
  817. }
  818. func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) {
  819. type NoMethod EnterpriseAccount
  820. raw := NoMethod(*s)
  821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  822. }
  823. // EnterprisesListResponse: The matching enterprise resources.
  824. type EnterprisesListResponse struct {
  825. // Enterprise: An enterprise.
  826. Enterprise []*Enterprise `json:"enterprise,omitempty"`
  827. // Kind: Identifies what kind of resource this is. Value: the fixed
  828. // string "androidenterprise#enterprisesListResponse".
  829. Kind string `json:"kind,omitempty"`
  830. // ServerResponse contains the HTTP response code and headers from the
  831. // server.
  832. googleapi.ServerResponse `json:"-"`
  833. // ForceSendFields is a list of field names (e.g. "Enterprise") to
  834. // unconditionally include in API requests. By default, fields with
  835. // empty values are omitted from API requests. However, any non-pointer,
  836. // non-interface field appearing in ForceSendFields will be sent to the
  837. // server regardless of whether the field is empty or not. This may be
  838. // used to include empty fields in Patch requests.
  839. ForceSendFields []string `json:"-"`
  840. // NullFields is a list of field names (e.g. "Enterprise") to include in
  841. // API requests with the JSON null value. By default, fields with empty
  842. // values are omitted from API requests. However, any field with an
  843. // empty value appearing in NullFields will be sent to the server as
  844. // null. It is an error if a field in this list has a non-empty value.
  845. // This may be used to include null fields in Patch requests.
  846. NullFields []string `json:"-"`
  847. }
  848. func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) {
  849. type NoMethod EnterprisesListResponse
  850. raw := NoMethod(*s)
  851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  852. }
  853. type EnterprisesSendTestPushNotificationResponse struct {
  854. // MessageId: The message ID of the test push notification that was
  855. // sent.
  856. MessageId string `json:"messageId,omitempty"`
  857. // TopicName: The name of the Cloud Pub/Sub topic to which notifications
  858. // for this enterprise's enrolled account will be sent.
  859. TopicName string `json:"topicName,omitempty"`
  860. // ServerResponse contains the HTTP response code and headers from the
  861. // server.
  862. googleapi.ServerResponse `json:"-"`
  863. // ForceSendFields is a list of field names (e.g. "MessageId") to
  864. // unconditionally include in API requests. By default, fields with
  865. // empty values are omitted from API requests. However, any non-pointer,
  866. // non-interface field appearing in ForceSendFields will be sent to the
  867. // server regardless of whether the field is empty or not. This may be
  868. // used to include empty fields in Patch requests.
  869. ForceSendFields []string `json:"-"`
  870. // NullFields is a list of field names (e.g. "MessageId") to include in
  871. // API requests with the JSON null value. By default, fields with empty
  872. // values are omitted from API requests. However, any field with an
  873. // empty value appearing in NullFields will be sent to the server as
  874. // null. It is an error if a field in this list has a non-empty value.
  875. // This may be used to include null fields in Patch requests.
  876. NullFields []string `json:"-"`
  877. }
  878. func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) {
  879. type NoMethod EnterprisesSendTestPushNotificationResponse
  880. raw := NoMethod(*s)
  881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  882. }
  883. // Entitlement: The presence of an Entitlements resource indicates that
  884. // a user has the right to use a particular app. Entitlements are user
  885. // specific, not device specific. This allows a user with an entitlement
  886. // to an app to install the app on all their devices. It's also possible
  887. // for a user to hold an entitlement to an app without installing the
  888. // app on any device.
  889. //
  890. // The API can be used to create an entitlement. As an option, you can
  891. // also use the API to trigger the installation of an app on all a
  892. // user's managed devices at the same time the entitlement is
  893. // created.
  894. //
  895. // If the app is free, creating the entitlement also creates a group
  896. // license for that app. For paid apps, creating the entitlement
  897. // consumes one license, and that license remains consumed until the
  898. // entitlement is removed. If the enterprise hasn't purchased enough
  899. // licenses, then no entitlement is created and the installation fails.
  900. // An entitlement is also not created for an app if the app requires
  901. // permissions that the enterprise hasn't accepted.
  902. //
  903. // If an entitlement is deleted, the app may be uninstalled from a
  904. // user's device. As a best practice, uninstall the app by calling
  905. // Installs.delete() before deleting the entitlement.
  906. //
  907. // Entitlements for apps that a user pays for on an unmanaged profile
  908. // have "userPurchase" as the entitlement reason. These entitlements
  909. // cannot be removed via the API.
  910. type Entitlement struct {
  911. // Kind: Identifies what kind of resource this is. Value: the fixed
  912. // string "androidenterprise#entitlement".
  913. Kind string `json:"kind,omitempty"`
  914. // ProductId: The ID of the product that the entitlement is for. For
  915. // example, "app:com.google.android.gm".
  916. ProductId string `json:"productId,omitempty"`
  917. // Reason: The reason for the entitlement. For example, "free" for free
  918. // apps. This property is temporary: it will be replaced by the
  919. // acquisition kind field of group licenses.
  920. Reason string `json:"reason,omitempty"`
  921. // ServerResponse contains the HTTP response code and headers from the
  922. // server.
  923. googleapi.ServerResponse `json:"-"`
  924. // ForceSendFields is a list of field names (e.g. "Kind") to
  925. // unconditionally include in API requests. By default, fields with
  926. // empty values are omitted from API requests. However, any non-pointer,
  927. // non-interface field appearing in ForceSendFields will be sent to the
  928. // server regardless of whether the field is empty or not. This may be
  929. // used to include empty fields in Patch requests.
  930. ForceSendFields []string `json:"-"`
  931. // NullFields is a list of field names (e.g. "Kind") to include in API
  932. // requests with the JSON null value. By default, fields with empty
  933. // values are omitted from API requests. However, any field with an
  934. // empty value appearing in NullFields will be sent to the server as
  935. // null. It is an error if a field in this list has a non-empty value.
  936. // This may be used to include null fields in Patch requests.
  937. NullFields []string `json:"-"`
  938. }
  939. func (s *Entitlement) MarshalJSON() ([]byte, error) {
  940. type NoMethod Entitlement
  941. raw := NoMethod(*s)
  942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  943. }
  944. // EntitlementsListResponse: The entitlement resources for the user.
  945. type EntitlementsListResponse struct {
  946. // Entitlement: An entitlement of a user to a product (e.g. an app). For
  947. // example, a free app that they have installed, or a paid app that they
  948. // have been allocated a license to.
  949. Entitlement []*Entitlement `json:"entitlement,omitempty"`
  950. // Kind: Identifies what kind of resource this is. Value: the fixed
  951. // string "androidenterprise#entitlementsListResponse".
  952. Kind string `json:"kind,omitempty"`
  953. // ServerResponse contains the HTTP response code and headers from the
  954. // server.
  955. googleapi.ServerResponse `json:"-"`
  956. // ForceSendFields is a list of field names (e.g. "Entitlement") to
  957. // unconditionally include in API requests. By default, fields with
  958. // empty values are omitted from API requests. However, any non-pointer,
  959. // non-interface field appearing in ForceSendFields will be sent to the
  960. // server regardless of whether the field is empty or not. This may be
  961. // used to include empty fields in Patch requests.
  962. ForceSendFields []string `json:"-"`
  963. // NullFields is a list of field names (e.g. "Entitlement") to include
  964. // in API requests with the JSON null value. By default, fields with
  965. // empty values are omitted from API requests. However, any field with
  966. // an empty value appearing in NullFields will be sent to the server as
  967. // null. It is an error if a field in this list has a non-empty value.
  968. // This may be used to include null fields in Patch requests.
  969. NullFields []string `json:"-"`
  970. }
  971. func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) {
  972. type NoMethod EntitlementsListResponse
  973. raw := NoMethod(*s)
  974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  975. }
  976. // GroupLicense: Group license objects allow you to keep track of
  977. // licenses (called entitlements) for both free and paid apps. For a
  978. // free app, a group license is created when an enterprise admin first
  979. // approves the product in Google Play or when the first entitlement for
  980. // the product is created for a user via the API. For a paid app, a
  981. // group license object is only created when an enterprise admin
  982. // purchases the product in Google Play for the first time.
  983. //
  984. // Use the API to query group licenses. A Grouplicenses resource
  985. // includes the total number of licenses purchased (paid apps only) and
  986. // the total number of licenses currently in use. In other words, the
  987. // total number of Entitlements that exist for the product.
  988. //
  989. // Only one group license object is created per product and group
  990. // license objects are never deleted. If a product is unapproved, its
  991. // group license remains. This allows enterprise admins to keep track of
  992. // any remaining entitlements for the product.
  993. type GroupLicense struct {
  994. // AcquisitionKind: How this group license was acquired. "bulkPurchase"
  995. // means that this Grouplicenses resource was created because the
  996. // enterprise purchased licenses for this product; otherwise, the value
  997. // is "free" (for free products).
  998. AcquisitionKind string `json:"acquisitionKind,omitempty"`
  999. // Approval: Whether the product to which this group license relates is
  1000. // currently approved by the enterprise. Products are approved when a
  1001. // group license is first created, but this approval may be revoked by
  1002. // an enterprise admin via Google Play. Unapproved products will not be
  1003. // visible to end users in collections, and new entitlements to them
  1004. // should not normally be created.
  1005. Approval string `json:"approval,omitempty"`
  1006. // Kind: Identifies what kind of resource this is. Value: the fixed
  1007. // string "androidenterprise#groupLicense".
  1008. Kind string `json:"kind,omitempty"`
  1009. // NumProvisioned: The total number of provisioned licenses for this
  1010. // product. Returned by read operations, but ignored in write
  1011. // operations.
  1012. NumProvisioned int64 `json:"numProvisioned,omitempty"`
  1013. // NumPurchased: The number of purchased licenses (possibly in multiple
  1014. // purchases). If this field is omitted, then there is no limit on the
  1015. // number of licenses that can be provisioned (for example, if the
  1016. // acquisition kind is "free").
  1017. NumPurchased int64 `json:"numPurchased,omitempty"`
  1018. // Permissions: The permission approval status of the product. This
  1019. // field is only set if the product is approved. Possible states are:
  1020. // - "currentApproved", the current set of permissions is approved, but
  1021. // additional permissions will require the administrator to reapprove
  1022. // the product (If the product was approved without specifying the
  1023. // approved permissions setting, then this is the default behavior.),
  1024. // - "needsReapproval", the product has unapproved permissions. No
  1025. // additional product licenses can be assigned until the product is
  1026. // reapproved,
  1027. // - "allCurrentAndFutureApproved", the current permissions are approved
  1028. // and any future permission updates will be automatically approved
  1029. // without administrator review.
  1030. Permissions string `json:"permissions,omitempty"`
  1031. // ProductId: The ID of the product that the license is for. For
  1032. // example, "app:com.google.android.gm".
  1033. ProductId string `json:"productId,omitempty"`
  1034. // ServerResponse contains the HTTP response code and headers from the
  1035. // server.
  1036. googleapi.ServerResponse `json:"-"`
  1037. // ForceSendFields is a list of field names (e.g. "AcquisitionKind") to
  1038. // unconditionally include in API requests. By default, fields with
  1039. // empty values are omitted from API requests. However, any non-pointer,
  1040. // non-interface field appearing in ForceSendFields will be sent to the
  1041. // server regardless of whether the field is empty or not. This may be
  1042. // used to include empty fields in Patch requests.
  1043. ForceSendFields []string `json:"-"`
  1044. // NullFields is a list of field names (e.g. "AcquisitionKind") to
  1045. // include in API requests with the JSON null value. By default, fields
  1046. // with empty values are omitted from API requests. However, any field
  1047. // with an empty value appearing in NullFields will be sent to the
  1048. // server as null. It is an error if a field in this list has a
  1049. // non-empty value. This may be used to include null fields in Patch
  1050. // requests.
  1051. NullFields []string `json:"-"`
  1052. }
  1053. func (s *GroupLicense) MarshalJSON() ([]byte, error) {
  1054. type NoMethod GroupLicense
  1055. raw := NoMethod(*s)
  1056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1057. }
  1058. // GroupLicenseUsersListResponse: The user resources for the group
  1059. // license.
  1060. type GroupLicenseUsersListResponse struct {
  1061. // Kind: Identifies what kind of resource this is. Value: the fixed
  1062. // string "androidenterprise#groupLicenseUsersListResponse".
  1063. Kind string `json:"kind,omitempty"`
  1064. // User: A user of an enterprise.
  1065. User []*User `json:"user,omitempty"`
  1066. // ServerResponse contains the HTTP response code and headers from the
  1067. // server.
  1068. googleapi.ServerResponse `json:"-"`
  1069. // ForceSendFields is a list of field names (e.g. "Kind") to
  1070. // unconditionally include in API requests. By default, fields with
  1071. // empty values are omitted from API requests. However, any non-pointer,
  1072. // non-interface field appearing in ForceSendFields will be sent to the
  1073. // server regardless of whether the field is empty or not. This may be
  1074. // used to include empty fields in Patch requests.
  1075. ForceSendFields []string `json:"-"`
  1076. // NullFields is a list of field names (e.g. "Kind") to include in API
  1077. // requests with the JSON null value. By default, fields with empty
  1078. // values are omitted from API requests. However, any field with an
  1079. // empty value appearing in NullFields will be sent to the server as
  1080. // null. It is an error if a field in this list has a non-empty value.
  1081. // This may be used to include null fields in Patch requests.
  1082. NullFields []string `json:"-"`
  1083. }
  1084. func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) {
  1085. type NoMethod GroupLicenseUsersListResponse
  1086. raw := NoMethod(*s)
  1087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1088. }
  1089. // GroupLicensesListResponse: The grouplicense resources for the
  1090. // enterprise.
  1091. type GroupLicensesListResponse struct {
  1092. // GroupLicense: A group license for a product approved for use in the
  1093. // enterprise.
  1094. GroupLicense []*GroupLicense `json:"groupLicense,omitempty"`
  1095. // Kind: Identifies what kind of resource this is. Value: the fixed
  1096. // string "androidenterprise#groupLicensesListResponse".
  1097. Kind string `json:"kind,omitempty"`
  1098. // ServerResponse contains the HTTP response code and headers from the
  1099. // server.
  1100. googleapi.ServerResponse `json:"-"`
  1101. // ForceSendFields is a list of field names (e.g. "GroupLicense") to
  1102. // unconditionally include in API requests. By default, fields with
  1103. // empty values are omitted from API requests. However, any non-pointer,
  1104. // non-interface field appearing in ForceSendFields will be sent to the
  1105. // server regardless of whether the field is empty or not. This may be
  1106. // used to include empty fields in Patch requests.
  1107. ForceSendFields []string `json:"-"`
  1108. // NullFields is a list of field names (e.g. "GroupLicense") to include
  1109. // in API requests with the JSON null value. By default, fields with
  1110. // empty values are omitted from API requests. However, any field with
  1111. // an empty value appearing in NullFields will be sent to the server as
  1112. // null. It is an error if a field in this list has a non-empty value.
  1113. // This may be used to include null fields in Patch requests.
  1114. NullFields []string `json:"-"`
  1115. }
  1116. func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) {
  1117. type NoMethod GroupLicensesListResponse
  1118. raw := NoMethod(*s)
  1119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1120. }
  1121. // Install: The existence of an Installs resource indicates that an app
  1122. // is installed on a particular device (or that an install is
  1123. // pending).
  1124. //
  1125. // The API can be used to create an install resource using the update
  1126. // method. This triggers the actual install of the app on the device. If
  1127. // the user does not already have an entitlement for the app, then an
  1128. // attempt is made to create one. If this fails (for example, because
  1129. // the app is not free and there is no available license), then the
  1130. // creation of the install fails.
  1131. //
  1132. // The API can also be used to update an installed app. If
  1133. // the update method is used on an existing install, then the app will
  1134. // be updated to the latest available version.
  1135. //
  1136. // Note that it is not possible to force the installation of a specific
  1137. // version of an app: the version code is read-only.
  1138. //
  1139. // If a user installs an app themselves (as permitted by the
  1140. // enterprise), then again an install resource and possibly an
  1141. // entitlement resource are automatically created.
  1142. //
  1143. // The API can also be used to delete an install resource, which
  1144. // triggers the removal of the app from the device. Note that deleting
  1145. // an install does not automatically remove the corresponding
  1146. // entitlement, even if there are no remaining installs. The install
  1147. // resource will also be deleted if the user uninstalls the app
  1148. // themselves.
  1149. type Install struct {
  1150. // InstallState: Install state. The state "installPending" means that an
  1151. // install request has recently been made and download to the device is
  1152. // in progress. The state "installed" means that the app has been
  1153. // installed. This field is read-only.
  1154. InstallState string `json:"installState,omitempty"`
  1155. // Kind: Identifies what kind of resource this is. Value: the fixed
  1156. // string "androidenterprise#install".
  1157. Kind string `json:"kind,omitempty"`
  1158. // ProductId: The ID of the product that the install is for. For
  1159. // example, "app:com.google.android.gm".
  1160. ProductId string `json:"productId,omitempty"`
  1161. // VersionCode: The version of the installed product. Guaranteed to be
  1162. // set only if the install state is "installed".
  1163. VersionCode int64 `json:"versionCode,omitempty"`
  1164. // ServerResponse contains the HTTP response code and headers from the
  1165. // server.
  1166. googleapi.ServerResponse `json:"-"`
  1167. // ForceSendFields is a list of field names (e.g. "InstallState") to
  1168. // unconditionally include in API requests. By default, fields with
  1169. // empty values are omitted from API requests. However, any non-pointer,
  1170. // non-interface field appearing in ForceSendFields will be sent to the
  1171. // server regardless of whether the field is empty or not. This may be
  1172. // used to include empty fields in Patch requests.
  1173. ForceSendFields []string `json:"-"`
  1174. // NullFields is a list of field names (e.g. "InstallState") to include
  1175. // in API requests with the JSON null value. By default, fields with
  1176. // empty values are omitted from API requests. However, any field with
  1177. // an empty value appearing in NullFields will be sent to the server as
  1178. // null. It is an error if a field in this list has a non-empty value.
  1179. // This may be used to include null fields in Patch requests.
  1180. NullFields []string `json:"-"`
  1181. }
  1182. func (s *Install) MarshalJSON() ([]byte, error) {
  1183. type NoMethod Install
  1184. raw := NoMethod(*s)
  1185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1186. }
  1187. // InstallFailureEvent: An event generated when an app installation
  1188. // failed on a device
  1189. type InstallFailureEvent struct {
  1190. // DeviceId: The Android ID of the device. This field will always be
  1191. // present.
  1192. DeviceId string `json:"deviceId,omitempty"`
  1193. // FailureDetails: Additional details on the failure if applicable.
  1194. FailureDetails string `json:"failureDetails,omitempty"`
  1195. // FailureReason: The reason for the installation failure. This field
  1196. // will always be present.
  1197. FailureReason string `json:"failureReason,omitempty"`
  1198. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  1199. // for which the install failure event occured. This field will always
  1200. // be present.
  1201. ProductId string `json:"productId,omitempty"`
  1202. // UserId: The ID of the user. This field will always be present.
  1203. UserId string `json:"userId,omitempty"`
  1204. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1205. // unconditionally include in API requests. By default, fields with
  1206. // empty values are omitted from API requests. However, any non-pointer,
  1207. // non-interface field appearing in ForceSendFields will be sent to the
  1208. // server regardless of whether the field is empty or not. This may be
  1209. // used to include empty fields in Patch requests.
  1210. ForceSendFields []string `json:"-"`
  1211. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1212. // API requests with the JSON null value. By default, fields with empty
  1213. // values are omitted from API requests. However, any field with an
  1214. // empty value appearing in NullFields will be sent to the server as
  1215. // null. It is an error if a field in this list has a non-empty value.
  1216. // This may be used to include null fields in Patch requests.
  1217. NullFields []string `json:"-"`
  1218. }
  1219. func (s *InstallFailureEvent) MarshalJSON() ([]byte, error) {
  1220. type NoMethod InstallFailureEvent
  1221. raw := NoMethod(*s)
  1222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1223. }
  1224. // InstallsListResponse: The install resources for the device.
  1225. type InstallsListResponse struct {
  1226. // Install: An installation of an app for a user on a specific device.
  1227. // The existence of an install implies that the user must have an
  1228. // entitlement to the app.
  1229. Install []*Install `json:"install,omitempty"`
  1230. // Kind: Identifies what kind of resource this is. Value: the fixed
  1231. // string "androidenterprise#installsListResponse".
  1232. Kind string `json:"kind,omitempty"`
  1233. // ServerResponse contains the HTTP response code and headers from the
  1234. // server.
  1235. googleapi.ServerResponse `json:"-"`
  1236. // ForceSendFields is a list of field names (e.g. "Install") to
  1237. // unconditionally include in API requests. By default, fields with
  1238. // empty values are omitted from API requests. However, any non-pointer,
  1239. // non-interface field appearing in ForceSendFields will be sent to the
  1240. // server regardless of whether the field is empty or not. This may be
  1241. // used to include empty fields in Patch requests.
  1242. ForceSendFields []string `json:"-"`
  1243. // NullFields is a list of field names (e.g. "Install") to include in
  1244. // API requests with the JSON null value. By default, fields with empty
  1245. // values are omitted from API requests. However, any field with an
  1246. // empty value appearing in NullFields will be sent to the server as
  1247. // null. It is an error if a field in this list has a non-empty value.
  1248. // This may be used to include null fields in Patch requests.
  1249. NullFields []string `json:"-"`
  1250. }
  1251. func (s *InstallsListResponse) MarshalJSON() ([]byte, error) {
  1252. type NoMethod InstallsListResponse
  1253. raw := NoMethod(*s)
  1254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1255. }
  1256. // LocalizedText: A localized string with its locale.
  1257. type LocalizedText struct {
  1258. // Locale: The BCP47 tag for a locale. (e.g. "en-US", "de").
  1259. Locale string `json:"locale,omitempty"`
  1260. // Text: The text localized in the associated locale.
  1261. Text string `json:"text,omitempty"`
  1262. // ForceSendFields is a list of field names (e.g. "Locale") to
  1263. // unconditionally include in API requests. By default, fields with
  1264. // empty values are omitted from API requests. However, any non-pointer,
  1265. // non-interface field appearing in ForceSendFields will be sent to the
  1266. // server regardless of whether the field is empty or not. This may be
  1267. // used to include empty fields in Patch requests.
  1268. ForceSendFields []string `json:"-"`
  1269. // NullFields is a list of field names (e.g. "Locale") to include in API
  1270. // requests with the JSON null value. By default, fields with empty
  1271. // values are omitted from API requests. However, any field with an
  1272. // empty value appearing in NullFields will be sent to the server as
  1273. // null. It is an error if a field in this list has a non-empty value.
  1274. // This may be used to include null fields in Patch requests.
  1275. NullFields []string `json:"-"`
  1276. }
  1277. func (s *LocalizedText) MarshalJSON() ([]byte, error) {
  1278. type NoMethod LocalizedText
  1279. raw := NoMethod(*s)
  1280. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1281. }
  1282. // MaintenanceWindow: Maintenance window for managed Google Play
  1283. // Accounts. This allows Play store to update the apps on the foreground
  1284. // in the designated window.
  1285. type MaintenanceWindow struct {
  1286. // DurationMs: Duration of the maintenance window, in milliseconds. The
  1287. // duration must be between 30 minutes and 24 hours (inclusive).
  1288. DurationMs int64 `json:"durationMs,omitempty,string"`
  1289. // StartTimeAfterMidnightMs: Start time of the maintenance window, in
  1290. // milliseconds after midnight on the device. Windows can span midnight.
  1291. StartTimeAfterMidnightMs int64 `json:"startTimeAfterMidnightMs,omitempty,string"`
  1292. // ForceSendFields is a list of field names (e.g. "DurationMs") to
  1293. // unconditionally include in API requests. By default, fields with
  1294. // empty values are omitted from API requests. However, any non-pointer,
  1295. // non-interface field appearing in ForceSendFields will be sent to the
  1296. // server regardless of whether the field is empty or not. This may be
  1297. // used to include empty fields in Patch requests.
  1298. ForceSendFields []string `json:"-"`
  1299. // NullFields is a list of field names (e.g. "DurationMs") to include in
  1300. // API requests with the JSON null value. By default, fields with empty
  1301. // values are omitted from API requests. However, any field with an
  1302. // empty value appearing in NullFields will be sent to the server as
  1303. // null. It is an error if a field in this list has a non-empty value.
  1304. // This may be used to include null fields in Patch requests.
  1305. NullFields []string `json:"-"`
  1306. }
  1307. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1308. type NoMethod MaintenanceWindow
  1309. raw := NoMethod(*s)
  1310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1311. }
  1312. // ManagedConfiguration: A managed configuration resource contains the
  1313. // set of managed properties defined by the app developer in the app's
  1314. // managed configurations schema, as well as any configuration variables
  1315. // defined for the user.
  1316. type ManagedConfiguration struct {
  1317. // ConfigurationVariables: Contains the ID of the managed configuration
  1318. // profile and the set of configuration variables (if any) defined for
  1319. // the user.
  1320. ConfigurationVariables *ConfigurationVariables `json:"configurationVariables,omitempty"`
  1321. // Kind: Identifies what kind of resource this is. Value: the fixed
  1322. // string "androidenterprise#managedConfiguration".
  1323. Kind string `json:"kind,omitempty"`
  1324. // ManagedProperty: The set of managed properties for this
  1325. // configuration.
  1326. ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"`
  1327. // ProductId: The ID of the product that the managed configuration is
  1328. // for, e.g. "app:com.google.android.gm".
  1329. ProductId string `json:"productId,omitempty"`
  1330. // ServerResponse contains the HTTP response code and headers from the
  1331. // server.
  1332. googleapi.ServerResponse `json:"-"`
  1333. // ForceSendFields is a list of field names (e.g.
  1334. // "ConfigurationVariables") to unconditionally include in API requests.
  1335. // By default, fields with empty values are omitted from API requests.
  1336. // However, any non-pointer, non-interface field appearing in
  1337. // ForceSendFields will be sent to the server regardless of whether the
  1338. // field is empty or not. This may be used to include empty fields in
  1339. // Patch requests.
  1340. ForceSendFields []string `json:"-"`
  1341. // NullFields is a list of field names (e.g. "ConfigurationVariables")
  1342. // to include in API requests with the JSON null value. By default,
  1343. // fields with empty values are omitted from API requests. However, any
  1344. // field with an empty value appearing in NullFields will be sent to the
  1345. // server as null. It is an error if a field in this list has a
  1346. // non-empty value. This may be used to include null fields in Patch
  1347. // requests.
  1348. NullFields []string `json:"-"`
  1349. }
  1350. func (s *ManagedConfiguration) MarshalJSON() ([]byte, error) {
  1351. type NoMethod ManagedConfiguration
  1352. raw := NoMethod(*s)
  1353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1354. }
  1355. // ManagedConfigurationsForDeviceListResponse: The managed configuration
  1356. // resources for the device.
  1357. type ManagedConfigurationsForDeviceListResponse struct {
  1358. // Kind: Identifies what kind of resource this is. Value: the fixed
  1359. // string
  1360. // "androidenterprise#managedConfigurationsForDeviceListResponse".
  1361. Kind string `json:"kind,omitempty"`
  1362. // ManagedConfigurationForDevice: A managed configuration for an app on
  1363. // a specific device.
  1364. ManagedConfigurationForDevice []*ManagedConfiguration `json:"managedConfigurationForDevice,omitempty"`
  1365. // ServerResponse contains the HTTP response code and headers from the
  1366. // server.
  1367. googleapi.ServerResponse `json:"-"`
  1368. // ForceSendFields is a list of field names (e.g. "Kind") to
  1369. // unconditionally include in API requests. By default, fields with
  1370. // empty values are omitted from API requests. However, any non-pointer,
  1371. // non-interface field appearing in ForceSendFields will be sent to the
  1372. // server regardless of whether the field is empty or not. This may be
  1373. // used to include empty fields in Patch requests.
  1374. ForceSendFields []string `json:"-"`
  1375. // NullFields is a list of field names (e.g. "Kind") to include in API
  1376. // requests with the JSON null value. By default, fields with empty
  1377. // values are omitted from API requests. However, any field with an
  1378. // empty value appearing in NullFields will be sent to the server as
  1379. // null. It is an error if a field in this list has a non-empty value.
  1380. // This may be used to include null fields in Patch requests.
  1381. NullFields []string `json:"-"`
  1382. }
  1383. func (s *ManagedConfigurationsForDeviceListResponse) MarshalJSON() ([]byte, error) {
  1384. type NoMethod ManagedConfigurationsForDeviceListResponse
  1385. raw := NoMethod(*s)
  1386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1387. }
  1388. // ManagedConfigurationsForUserListResponse: The managed configuration
  1389. // resources for the user.
  1390. type ManagedConfigurationsForUserListResponse struct {
  1391. // Kind: Identifies what kind of resource this is. Value: the fixed
  1392. // string "androidenterprise#managedConfigurationsForUserListResponse".
  1393. Kind string `json:"kind,omitempty"`
  1394. // ManagedConfigurationForUser: A managed configuration for an app for a
  1395. // specific user.
  1396. ManagedConfigurationForUser []*ManagedConfiguration `json:"managedConfigurationForUser,omitempty"`
  1397. // ServerResponse contains the HTTP response code and headers from the
  1398. // server.
  1399. googleapi.ServerResponse `json:"-"`
  1400. // ForceSendFields is a list of field names (e.g. "Kind") to
  1401. // unconditionally include in API requests. By default, fields with
  1402. // empty values are omitted from API requests. However, any non-pointer,
  1403. // non-interface field appearing in ForceSendFields will be sent to the
  1404. // server regardless of whether the field is empty or not. This may be
  1405. // used to include empty fields in Patch requests.
  1406. ForceSendFields []string `json:"-"`
  1407. // NullFields is a list of field names (e.g. "Kind") to include in API
  1408. // requests with the JSON null value. By default, fields with empty
  1409. // values are omitted from API requests. However, any field with an
  1410. // empty value appearing in NullFields will be sent to the server as
  1411. // null. It is an error if a field in this list has a non-empty value.
  1412. // This may be used to include null fields in Patch requests.
  1413. NullFields []string `json:"-"`
  1414. }
  1415. func (s *ManagedConfigurationsForUserListResponse) MarshalJSON() ([]byte, error) {
  1416. type NoMethod ManagedConfigurationsForUserListResponse
  1417. raw := NoMethod(*s)
  1418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1419. }
  1420. // ManagedConfigurationsSettings: A managed configurations settings
  1421. // resource contains the set of managed properties that have been
  1422. // configured for an Android app to be applied to a set of users. The
  1423. // app's developer would have defined configurable properties in the
  1424. // managed configurations schema.
  1425. type ManagedConfigurationsSettings struct {
  1426. // Kind: Identifies what kind of resource this is. Value: the fixed
  1427. // string "androidenterprise#managedConfigurationsSettings".
  1428. Kind string `json:"kind,omitempty"`
  1429. // LastUpdatedTimestampMillis: The last updated time of the managed
  1430. // configuration settings in milliseconds since 1970-01-01T00:00:00Z.
  1431. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  1432. // ManagedProperty: The set of managed properties for this
  1433. // configuration.
  1434. ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"`
  1435. // McmId: The ID of the managed configurations settings.
  1436. McmId string `json:"mcmId,omitempty"`
  1437. // Name: The name of the managed configurations settings.
  1438. Name string `json:"name,omitempty"`
  1439. // ForceSendFields is a list of field names (e.g. "Kind") to
  1440. // unconditionally include in API requests. By default, fields with
  1441. // empty values are omitted from API requests. However, any non-pointer,
  1442. // non-interface field appearing in ForceSendFields will be sent to the
  1443. // server regardless of whether the field is empty or not. This may be
  1444. // used to include empty fields in Patch requests.
  1445. ForceSendFields []string `json:"-"`
  1446. // NullFields is a list of field names (e.g. "Kind") to include in API
  1447. // requests with the JSON null value. By default, fields with empty
  1448. // values are omitted from API requests. However, any field with an
  1449. // empty value appearing in NullFields will be sent to the server as
  1450. // null. It is an error if a field in this list has a non-empty value.
  1451. // This may be used to include null fields in Patch requests.
  1452. NullFields []string `json:"-"`
  1453. }
  1454. func (s *ManagedConfigurationsSettings) MarshalJSON() ([]byte, error) {
  1455. type NoMethod ManagedConfigurationsSettings
  1456. raw := NoMethod(*s)
  1457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1458. }
  1459. // ManagedConfigurationsSettingsListResponse: The managed configurations
  1460. // settings for a product.
  1461. type ManagedConfigurationsSettingsListResponse struct {
  1462. // Kind: Identifies what kind of resource this is. Value: the fixed
  1463. // string "androidenterprise#managedConfigurationsSettingsListResponse".
  1464. Kind string `json:"kind,omitempty"`
  1465. // ManagedConfigurationsSettings: A managed configurations settings for
  1466. // an app that may be assigned to a group of users in an enterprise.
  1467. ManagedConfigurationsSettings []*ManagedConfigurationsSettings `json:"managedConfigurationsSettings,omitempty"`
  1468. // ServerResponse contains the HTTP response code and headers from the
  1469. // server.
  1470. googleapi.ServerResponse `json:"-"`
  1471. // ForceSendFields is a list of field names (e.g. "Kind") to
  1472. // unconditionally include in API requests. By default, fields with
  1473. // empty values are omitted from API requests. However, any non-pointer,
  1474. // non-interface field appearing in ForceSendFields will be sent to the
  1475. // server regardless of whether the field is empty or not. This may be
  1476. // used to include empty fields in Patch requests.
  1477. ForceSendFields []string `json:"-"`
  1478. // NullFields is a list of field names (e.g. "Kind") to include in API
  1479. // requests with the JSON null value. By default, fields with empty
  1480. // values are omitted from API requests. However, any field with an
  1481. // empty value appearing in NullFields will be sent to the server as
  1482. // null. It is an error if a field in this list has a non-empty value.
  1483. // This may be used to include null fields in Patch requests.
  1484. NullFields []string `json:"-"`
  1485. }
  1486. func (s *ManagedConfigurationsSettingsListResponse) MarshalJSON() ([]byte, error) {
  1487. type NoMethod ManagedConfigurationsSettingsListResponse
  1488. raw := NoMethod(*s)
  1489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1490. }
  1491. // ManagedProperty: A managed property of a managed configuration. The
  1492. // property must match one of the properties in the app restrictions
  1493. // schema of the product. Exactly one of the value fields must be
  1494. // populated, and it must match the property's type in the app
  1495. // restrictions schema.
  1496. type ManagedProperty struct {
  1497. // Key: The unique key that identifies the property.
  1498. Key string `json:"key,omitempty"`
  1499. // ValueBool: The boolean value - this will only be present if type of
  1500. // the property is bool.
  1501. ValueBool bool `json:"valueBool,omitempty"`
  1502. // ValueBundle: The bundle of managed properties - this will only be
  1503. // present if type of the property is bundle.
  1504. ValueBundle *ManagedPropertyBundle `json:"valueBundle,omitempty"`
  1505. // ValueBundleArray: The list of bundles of properties - this will only
  1506. // be present if type of the property is bundle_array.
  1507. ValueBundleArray []*ManagedPropertyBundle `json:"valueBundleArray,omitempty"`
  1508. // ValueInteger: The integer value - this will only be present if type
  1509. // of the property is integer.
  1510. ValueInteger int64 `json:"valueInteger,omitempty"`
  1511. // ValueString: The string value - this will only be present if type of
  1512. // the property is string, choice or hidden.
  1513. ValueString string `json:"valueString,omitempty"`
  1514. // ValueStringArray: The list of string values - this will only be
  1515. // present if type of the property is multiselect.
  1516. ValueStringArray []string `json:"valueStringArray,omitempty"`
  1517. // ForceSendFields is a list of field names (e.g. "Key") to
  1518. // unconditionally include in API requests. By default, fields with
  1519. // empty values are omitted from API requests. However, any non-pointer,
  1520. // non-interface field appearing in ForceSendFields will be sent to the
  1521. // server regardless of whether the field is empty or not. This may be
  1522. // used to include empty fields in Patch requests.
  1523. ForceSendFields []string `json:"-"`
  1524. // NullFields is a list of field names (e.g. "Key") to include in API
  1525. // requests with the JSON null value. By default, fields with empty
  1526. // values are omitted from API requests. However, any field with an
  1527. // empty value appearing in NullFields will be sent to the server as
  1528. // null. It is an error if a field in this list has a non-empty value.
  1529. // This may be used to include null fields in Patch requests.
  1530. NullFields []string `json:"-"`
  1531. }
  1532. func (s *ManagedProperty) MarshalJSON() ([]byte, error) {
  1533. type NoMethod ManagedProperty
  1534. raw := NoMethod(*s)
  1535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1536. }
  1537. // ManagedPropertyBundle: A bundle of managed properties.
  1538. type ManagedPropertyBundle struct {
  1539. // ManagedProperty: The list of managed properties.
  1540. ManagedProperty []*ManagedProperty `json:"managedProperty,omitempty"`
  1541. // ForceSendFields is a list of field names (e.g. "ManagedProperty") to
  1542. // unconditionally include in API requests. By default, fields with
  1543. // empty values are omitted from API requests. However, any non-pointer,
  1544. // non-interface field appearing in ForceSendFields will be sent to the
  1545. // server regardless of whether the field is empty or not. This may be
  1546. // used to include empty fields in Patch requests.
  1547. ForceSendFields []string `json:"-"`
  1548. // NullFields is a list of field names (e.g. "ManagedProperty") to
  1549. // include in API requests with the JSON null value. By default, fields
  1550. // with empty values are omitted from API requests. However, any field
  1551. // with an empty value appearing in NullFields will be sent to the
  1552. // server as null. It is an error if a field in this list has a
  1553. // non-empty value. This may be used to include null fields in Patch
  1554. // requests.
  1555. NullFields []string `json:"-"`
  1556. }
  1557. func (s *ManagedPropertyBundle) MarshalJSON() ([]byte, error) {
  1558. type NoMethod ManagedPropertyBundle
  1559. raw := NoMethod(*s)
  1560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1561. }
  1562. // NewDeviceEvent: An event generated when a new device is ready to be
  1563. // managed.
  1564. type NewDeviceEvent struct {
  1565. // DeviceId: The Android ID of the device. This field will always be
  1566. // present.
  1567. DeviceId string `json:"deviceId,omitempty"`
  1568. // DpcPackageName: Policy app on the device.
  1569. DpcPackageName string `json:"dpcPackageName,omitempty"`
  1570. // ManagementType: Identifies the extent to which the device is
  1571. // controlled by an Android EMM in various deployment
  1572. // configurations.
  1573. //
  1574. // Possible values include:
  1575. // - "managedDevice", a device where the DPC is set as device owner,
  1576. // - "managedProfile", a device where the DPC is set as profile owner.
  1577. ManagementType string `json:"managementType,omitempty"`
  1578. // UserId: The ID of the user. This field will always be present.
  1579. UserId string `json:"userId,omitempty"`
  1580. // ForceSendFields is a list of field names (e.g. "DeviceId") to
  1581. // unconditionally include in API requests. By default, fields with
  1582. // empty values are omitted from API requests. However, any non-pointer,
  1583. // non-interface field appearing in ForceSendFields will be sent to the
  1584. // server regardless of whether the field is empty or not. This may be
  1585. // used to include empty fields in Patch requests.
  1586. ForceSendFields []string `json:"-"`
  1587. // NullFields is a list of field names (e.g. "DeviceId") to include in
  1588. // API requests with the JSON null value. By default, fields with empty
  1589. // values are omitted from API requests. However, any field with an
  1590. // empty value appearing in NullFields will be sent to the server as
  1591. // null. It is an error if a field in this list has a non-empty value.
  1592. // This may be used to include null fields in Patch requests.
  1593. NullFields []string `json:"-"`
  1594. }
  1595. func (s *NewDeviceEvent) MarshalJSON() ([]byte, error) {
  1596. type NoMethod NewDeviceEvent
  1597. raw := NoMethod(*s)
  1598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1599. }
  1600. // NewPermissionsEvent: An event generated when new permissions are
  1601. // added to an app.
  1602. type NewPermissionsEvent struct {
  1603. // ApprovedPermissions: The set of permissions that the enterprise admin
  1604. // has already approved for this application. Use Permissions.Get on the
  1605. // EMM API to retrieve details about these permissions.
  1606. ApprovedPermissions []string `json:"approvedPermissions,omitempty"`
  1607. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  1608. // for which new permissions were added. This field will always be
  1609. // present.
  1610. ProductId string `json:"productId,omitempty"`
  1611. // RequestedPermissions: The set of permissions that the app is
  1612. // currently requesting. Use Permissions.Get on the EMM API to retrieve
  1613. // details about these permissions.
  1614. RequestedPermissions []string `json:"requestedPermissions,omitempty"`
  1615. // ForceSendFields is a list of field names (e.g. "ApprovedPermissions")
  1616. // to unconditionally include in API requests. By default, fields with
  1617. // empty values are omitted from API requests. However, any non-pointer,
  1618. // non-interface field appearing in ForceSendFields will be sent to the
  1619. // server regardless of whether the field is empty or not. This may be
  1620. // used to include empty fields in Patch requests.
  1621. ForceSendFields []string `json:"-"`
  1622. // NullFields is a list of field names (e.g. "ApprovedPermissions") to
  1623. // include in API requests with the JSON null value. By default, fields
  1624. // with empty values are omitted from API requests. However, any field
  1625. // with an empty value appearing in NullFields will be sent to the
  1626. // server as null. It is an error if a field in this list has a
  1627. // non-empty value. This may be used to include null fields in Patch
  1628. // requests.
  1629. NullFields []string `json:"-"`
  1630. }
  1631. func (s *NewPermissionsEvent) MarshalJSON() ([]byte, error) {
  1632. type NoMethod NewPermissionsEvent
  1633. raw := NoMethod(*s)
  1634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1635. }
  1636. // Notification: A notification of one event relating to an enterprise.
  1637. type Notification struct {
  1638. // AppRestrictionsSchemaChangeEvent: Notifications about new app
  1639. // restrictions schema changes.
  1640. AppRestrictionsSchemaChangeEvent *AppRestrictionsSchemaChangeEvent `json:"appRestrictionsSchemaChangeEvent,omitempty"`
  1641. // AppUpdateEvent: Notifications about app updates.
  1642. AppUpdateEvent *AppUpdateEvent `json:"appUpdateEvent,omitempty"`
  1643. // EnterpriseId: The ID of the enterprise for which the notification is
  1644. // sent. This will always be present.
  1645. EnterpriseId string `json:"enterpriseId,omitempty"`
  1646. // InstallFailureEvent: Notifications about an app installation failure.
  1647. InstallFailureEvent *InstallFailureEvent `json:"installFailureEvent,omitempty"`
  1648. // NewDeviceEvent: Notifications about new devices.
  1649. NewDeviceEvent *NewDeviceEvent `json:"newDeviceEvent,omitempty"`
  1650. // NewPermissionsEvent: Notifications about new app permissions.
  1651. NewPermissionsEvent *NewPermissionsEvent `json:"newPermissionsEvent,omitempty"`
  1652. // NotificationType: Type of the notification.
  1653. NotificationType string `json:"notificationType,omitempty"`
  1654. // ProductApprovalEvent: Notifications about changes to a product's
  1655. // approval status.
  1656. ProductApprovalEvent *ProductApprovalEvent `json:"productApprovalEvent,omitempty"`
  1657. // ProductAvailabilityChangeEvent: Notifications about product
  1658. // availability changes.
  1659. ProductAvailabilityChangeEvent *ProductAvailabilityChangeEvent `json:"productAvailabilityChangeEvent,omitempty"`
  1660. // TimestampMillis: The time when the notification was published in
  1661. // milliseconds since 1970-01-01T00:00:00Z. This will always be present.
  1662. TimestampMillis int64 `json:"timestampMillis,omitempty,string"`
  1663. // ForceSendFields is a list of field names (e.g.
  1664. // "AppRestrictionsSchemaChangeEvent") to unconditionally include in API
  1665. // requests. By default, fields with empty values are omitted from API
  1666. // requests. However, any non-pointer, non-interface field appearing in
  1667. // ForceSendFields will be sent to the server regardless of whether the
  1668. // field is empty or not. This may be used to include empty fields in
  1669. // Patch requests.
  1670. ForceSendFields []string `json:"-"`
  1671. // NullFields is a list of field names (e.g.
  1672. // "AppRestrictionsSchemaChangeEvent") to include in API requests with
  1673. // the JSON null value. By default, fields with empty values are omitted
  1674. // from API requests. However, any field with an empty value appearing
  1675. // in NullFields will be sent to the server as null. It is an error if a
  1676. // field in this list has a non-empty value. This may be used to include
  1677. // null fields in Patch requests.
  1678. NullFields []string `json:"-"`
  1679. }
  1680. func (s *Notification) MarshalJSON() ([]byte, error) {
  1681. type NoMethod Notification
  1682. raw := NoMethod(*s)
  1683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1684. }
  1685. // NotificationSet: A resource returned by the PullNotificationSet API,
  1686. // which contains a collection of notifications for enterprises
  1687. // associated with the service account authenticated for the request.
  1688. type NotificationSet struct {
  1689. // Kind: Identifies what kind of resource this is. Value: the fixed
  1690. // string "androidenterprise#notificationSet".
  1691. Kind string `json:"kind,omitempty"`
  1692. // Notification: The notifications received, or empty if no
  1693. // notifications are present.
  1694. Notification []*Notification `json:"notification,omitempty"`
  1695. // NotificationSetId: The notification set ID, required to mark the
  1696. // notification as received with the Enterprises.AcknowledgeNotification
  1697. // API. This will be omitted if no notifications are present.
  1698. NotificationSetId string `json:"notificationSetId,omitempty"`
  1699. // ServerResponse contains the HTTP response code and headers from the
  1700. // server.
  1701. googleapi.ServerResponse `json:"-"`
  1702. // ForceSendFields is a list of field names (e.g. "Kind") to
  1703. // unconditionally include in API requests. By default, fields with
  1704. // empty values are omitted from API requests. However, any non-pointer,
  1705. // non-interface field appearing in ForceSendFields will be sent to the
  1706. // server regardless of whether the field is empty or not. This may be
  1707. // used to include empty fields in Patch requests.
  1708. ForceSendFields []string `json:"-"`
  1709. // NullFields is a list of field names (e.g. "Kind") to include in API
  1710. // requests with the JSON null value. By default, fields with empty
  1711. // values are omitted from API requests. However, any field with an
  1712. // empty value appearing in NullFields will be sent to the server as
  1713. // null. It is an error if a field in this list has a non-empty value.
  1714. // This may be used to include null fields in Patch requests.
  1715. NullFields []string `json:"-"`
  1716. }
  1717. func (s *NotificationSet) MarshalJSON() ([]byte, error) {
  1718. type NoMethod NotificationSet
  1719. raw := NoMethod(*s)
  1720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1721. }
  1722. type PageInfo struct {
  1723. ResultPerPage int64 `json:"resultPerPage,omitempty"`
  1724. StartIndex int64 `json:"startIndex,omitempty"`
  1725. TotalResults int64 `json:"totalResults,omitempty"`
  1726. // ForceSendFields is a list of field names (e.g. "ResultPerPage") to
  1727. // unconditionally include in API requests. By default, fields with
  1728. // empty values are omitted from API requests. However, any non-pointer,
  1729. // non-interface field appearing in ForceSendFields will be sent to the
  1730. // server regardless of whether the field is empty or not. This may be
  1731. // used to include empty fields in Patch requests.
  1732. ForceSendFields []string `json:"-"`
  1733. // NullFields is a list of field names (e.g. "ResultPerPage") to include
  1734. // in API requests with the JSON null value. By default, fields with
  1735. // empty values are omitted from API requests. However, any field with
  1736. // an empty value appearing in NullFields will be sent to the server as
  1737. // null. It is an error if a field in this list has a non-empty value.
  1738. // This may be used to include null fields in Patch requests.
  1739. NullFields []string `json:"-"`
  1740. }
  1741. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  1742. type NoMethod PageInfo
  1743. raw := NoMethod(*s)
  1744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1745. }
  1746. // Permission: A Permissions resource represents some extra capability,
  1747. // to be granted to an Android app, which requires explicit consent. An
  1748. // enterprise admin must consent to these permissions on behalf of their
  1749. // users before an entitlement for the app can be created.
  1750. //
  1751. // The permissions collection is read-only. The information provided for
  1752. // each permission (localized name and description) is intended to be
  1753. // used in the MDM user interface when obtaining consent from the
  1754. // enterprise.
  1755. type Permission struct {
  1756. // Description: A longer description of the Permissions resource, giving
  1757. // more details of what it affects.
  1758. Description string `json:"description,omitempty"`
  1759. // Kind: Identifies what kind of resource this is. Value: the fixed
  1760. // string "androidenterprise#permission".
  1761. Kind string `json:"kind,omitempty"`
  1762. // Name: The name of the permission.
  1763. Name string `json:"name,omitempty"`
  1764. // PermissionId: An opaque string uniquely identifying the permission.
  1765. PermissionId string `json:"permissionId,omitempty"`
  1766. // ServerResponse contains the HTTP response code and headers from the
  1767. // server.
  1768. googleapi.ServerResponse `json:"-"`
  1769. // ForceSendFields is a list of field names (e.g. "Description") to
  1770. // unconditionally include in API requests. By default, fields with
  1771. // empty values are omitted from API requests. However, any non-pointer,
  1772. // non-interface field appearing in ForceSendFields will be sent to the
  1773. // server regardless of whether the field is empty or not. This may be
  1774. // used to include empty fields in Patch requests.
  1775. ForceSendFields []string `json:"-"`
  1776. // NullFields is a list of field names (e.g. "Description") to include
  1777. // in API requests with the JSON null value. By default, fields with
  1778. // empty values are omitted from API requests. However, any field with
  1779. // an empty value appearing in NullFields will be sent to the server as
  1780. // null. It is an error if a field in this list has a non-empty value.
  1781. // This may be used to include null fields in Patch requests.
  1782. NullFields []string `json:"-"`
  1783. }
  1784. func (s *Permission) MarshalJSON() ([]byte, error) {
  1785. type NoMethod Permission
  1786. raw := NoMethod(*s)
  1787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1788. }
  1789. // Policy: The device policy for a given managed device.
  1790. type Policy struct {
  1791. // AutoUpdatePolicy: The auto-update policy for apps installed on the
  1792. // device. "choiceToTheUser" allows the device's user to configure the
  1793. // app update policy. "always" enables auto updates. "never" disables
  1794. // auto updates. "wifiOnly" enables auto updates only when the device is
  1795. // connected to wifi.
  1796. AutoUpdatePolicy string `json:"autoUpdatePolicy,omitempty"`
  1797. // MaintenanceWindow: The maintenance window defining when apps running
  1798. // in the foreground should be updated.
  1799. MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
  1800. // ProductAvailabilityPolicy: The availability granted to the device for
  1801. // the specified products. "all" gives the device access to all
  1802. // products, regardless of approval status. "all" does not enable
  1803. // automatic visibility of "alpha" or "beta" tracks. "whitelist" grants
  1804. // the device access the products specified in productPolicy[]. Only
  1805. // products that are approved or products that were previously approved
  1806. // (products with revoked approval) by the enterprise can be
  1807. // whitelisted. If no value is provided, the availability set at the
  1808. // user level is applied by default.
  1809. ProductAvailabilityPolicy string `json:"productAvailabilityPolicy,omitempty"`
  1810. // ProductPolicy: The list of product policies.
  1811. ProductPolicy []*ProductPolicy `json:"productPolicy,omitempty"`
  1812. // ForceSendFields is a list of field names (e.g. "AutoUpdatePolicy") to
  1813. // unconditionally include in API requests. By default, fields with
  1814. // empty values are omitted from API requests. However, any non-pointer,
  1815. // non-interface field appearing in ForceSendFields will be sent to the
  1816. // server regardless of whether the field is empty or not. This may be
  1817. // used to include empty fields in Patch requests.
  1818. ForceSendFields []string `json:"-"`
  1819. // NullFields is a list of field names (e.g. "AutoUpdatePolicy") to
  1820. // include in API requests with the JSON null value. By default, fields
  1821. // with empty values are omitted from API requests. However, any field
  1822. // with an empty value appearing in NullFields will be sent to the
  1823. // server as null. It is an error if a field in this list has a
  1824. // non-empty value. This may be used to include null fields in Patch
  1825. // requests.
  1826. NullFields []string `json:"-"`
  1827. }
  1828. func (s *Policy) MarshalJSON() ([]byte, error) {
  1829. type NoMethod Policy
  1830. raw := NoMethod(*s)
  1831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1832. }
  1833. // Product: A Products resource represents an app in the Google Play
  1834. // store that is available to at least some users in the enterprise.
  1835. // (Some apps are restricted to a single enterprise, and no information
  1836. // about them is made available outside that enterprise.)
  1837. //
  1838. // The information provided for each product (localized name, icon, link
  1839. // to the full Google Play details page) is intended to allow a basic
  1840. // representation of the product within an EMM user interface.
  1841. type Product struct {
  1842. // AppVersion: App versions currently available for this product.
  1843. AppVersion []*AppVersion `json:"appVersion,omitempty"`
  1844. // AuthorName: The name of the author of the product (for example, the
  1845. // app developer).
  1846. AuthorName string `json:"authorName,omitempty"`
  1847. // AvailableCountries: The countries which this app is available in.
  1848. AvailableCountries []string `json:"availableCountries,omitempty"`
  1849. // AvailableTracks: The tracks that are visible to the enterprise.
  1850. AvailableTracks []string `json:"availableTracks,omitempty"`
  1851. // Category: The app category (e.g. RACING, SOCIAL, etc.)
  1852. Category string `json:"category,omitempty"`
  1853. // ContentRating: The content rating for this app.
  1854. ContentRating string `json:"contentRating,omitempty"`
  1855. // Description: The localized promotional description, if available.
  1856. Description string `json:"description,omitempty"`
  1857. // DetailsUrl: A link to the (consumer) Google Play details page for the
  1858. // product.
  1859. DetailsUrl string `json:"detailsUrl,omitempty"`
  1860. // DistributionChannel: How and to whom the package is made available.
  1861. // The value publicGoogleHosted means that the package is available
  1862. // through the Play store and not restricted to a specific enterprise.
  1863. // The value privateGoogleHosted means that the package is a private app
  1864. // (restricted to an enterprise) but hosted by Google. The value
  1865. // privateSelfHosted means that the package is a private app (restricted
  1866. // to an enterprise) and is privately hosted.
  1867. DistributionChannel string `json:"distributionChannel,omitempty"`
  1868. // IconUrl: A link to an image that can be used as an icon for the
  1869. // product. This image is suitable for use at up to 512px x 512px.
  1870. IconUrl string `json:"iconUrl,omitempty"`
  1871. // Kind: Identifies what kind of resource this is. Value: the fixed
  1872. // string "androidenterprise#product".
  1873. Kind string `json:"kind,omitempty"`
  1874. // LastUpdatedTimestampMillis: The approximate time (within 7 days) the
  1875. // app was last published, expressed in milliseconds since epoch.
  1876. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  1877. // MinAndroidSdkVersion: The minimum Android SDK necessary to run the
  1878. // app.
  1879. MinAndroidSdkVersion int64 `json:"minAndroidSdkVersion,omitempty"`
  1880. // Permissions: A list of permissions required by the app.
  1881. Permissions []*ProductPermission `json:"permissions,omitempty"`
  1882. // ProductId: A string of the form app:<package name>. For example,
  1883. // app:com.google.android.gm represents the Gmail app.
  1884. ProductId string `json:"productId,omitempty"`
  1885. // ProductPricing: Whether this product is free, free with in-app
  1886. // purchases, or paid. If the pricing is unknown, this means the product
  1887. // is not generally available anymore (even though it might still be
  1888. // available to people who own it).
  1889. ProductPricing string `json:"productPricing,omitempty"`
  1890. // RecentChanges: A description of the recent changes made to the app.
  1891. RecentChanges string `json:"recentChanges,omitempty"`
  1892. // RequiresContainerApp: Deprecated.
  1893. RequiresContainerApp bool `json:"requiresContainerApp,omitempty"`
  1894. // ScreenshotUrls: A list of screenshot links representing the app.
  1895. ScreenshotUrls []string `json:"screenshotUrls,omitempty"`
  1896. // SigningCertificate: The certificate used to sign this product.
  1897. SigningCertificate *ProductSigningCertificate `json:"signingCertificate,omitempty"`
  1898. // SmallIconUrl: A link to a smaller image that can be used as an icon
  1899. // for the product. This image is suitable for use at up to 128px x
  1900. // 128px.
  1901. SmallIconUrl string `json:"smallIconUrl,omitempty"`
  1902. // Title: The name of the product.
  1903. Title string `json:"title,omitempty"`
  1904. // WorkDetailsUrl: A link to the managed Google Play details page for
  1905. // the product, for use by an Enterprise admin.
  1906. WorkDetailsUrl string `json:"workDetailsUrl,omitempty"`
  1907. // ServerResponse contains the HTTP response code and headers from the
  1908. // server.
  1909. googleapi.ServerResponse `json:"-"`
  1910. // ForceSendFields is a list of field names (e.g. "AppVersion") to
  1911. // unconditionally include in API requests. By default, fields with
  1912. // empty values are omitted from API requests. However, any non-pointer,
  1913. // non-interface field appearing in ForceSendFields will be sent to the
  1914. // server regardless of whether the field is empty or not. This may be
  1915. // used to include empty fields in Patch requests.
  1916. ForceSendFields []string `json:"-"`
  1917. // NullFields is a list of field names (e.g. "AppVersion") to include in
  1918. // API requests with the JSON null value. By default, fields with empty
  1919. // values are omitted from API requests. However, any field with an
  1920. // empty value appearing in NullFields will be sent to the server as
  1921. // null. It is an error if a field in this list has a non-empty value.
  1922. // This may be used to include null fields in Patch requests.
  1923. NullFields []string `json:"-"`
  1924. }
  1925. func (s *Product) MarshalJSON() ([]byte, error) {
  1926. type NoMethod Product
  1927. raw := NoMethod(*s)
  1928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1929. }
  1930. // ProductApprovalEvent: An event generated when a product's approval
  1931. // status is changed.
  1932. type ProductApprovalEvent struct {
  1933. // Approved: Whether the product was approved or unapproved. This field
  1934. // will always be present.
  1935. Approved string `json:"approved,omitempty"`
  1936. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  1937. // for which the approval status has changed. This field will always be
  1938. // present.
  1939. ProductId string `json:"productId,omitempty"`
  1940. // ForceSendFields is a list of field names (e.g. "Approved") to
  1941. // unconditionally include in API requests. By default, fields with
  1942. // empty values are omitted from API requests. However, any non-pointer,
  1943. // non-interface field appearing in ForceSendFields will be sent to the
  1944. // server regardless of whether the field is empty or not. This may be
  1945. // used to include empty fields in Patch requests.
  1946. ForceSendFields []string `json:"-"`
  1947. // NullFields is a list of field names (e.g. "Approved") to include in
  1948. // API requests with the JSON null value. By default, fields with empty
  1949. // values are omitted from API requests. However, any field with an
  1950. // empty value appearing in NullFields will be sent to the server as
  1951. // null. It is an error if a field in this list has a non-empty value.
  1952. // This may be used to include null fields in Patch requests.
  1953. NullFields []string `json:"-"`
  1954. }
  1955. func (s *ProductApprovalEvent) MarshalJSON() ([]byte, error) {
  1956. type NoMethod ProductApprovalEvent
  1957. raw := NoMethod(*s)
  1958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1959. }
  1960. // ProductAvailabilityChangeEvent: An event generated whenever a
  1961. // product's availability changes.
  1962. type ProductAvailabilityChangeEvent struct {
  1963. // AvailabilityStatus: The new state of the product. This field will
  1964. // always be present.
  1965. AvailabilityStatus string `json:"availabilityStatus,omitempty"`
  1966. // ProductId: The id of the product (e.g. "app:com.google.android.gm")
  1967. // for which the product availability changed. This field will always be
  1968. // present.
  1969. ProductId string `json:"productId,omitempty"`
  1970. // ForceSendFields is a list of field names (e.g. "AvailabilityStatus")
  1971. // to unconditionally include in API requests. By default, fields with
  1972. // empty values are omitted from API requests. However, any non-pointer,
  1973. // non-interface field appearing in ForceSendFields will be sent to the
  1974. // server regardless of whether the field is empty or not. This may be
  1975. // used to include empty fields in Patch requests.
  1976. ForceSendFields []string `json:"-"`
  1977. // NullFields is a list of field names (e.g. "AvailabilityStatus") to
  1978. // include in API requests with the JSON null value. By default, fields
  1979. // with empty values are omitted from API requests. However, any field
  1980. // with an empty value appearing in NullFields will be sent to the
  1981. // server as null. It is an error if a field in this list has a
  1982. // non-empty value. This may be used to include null fields in Patch
  1983. // requests.
  1984. NullFields []string `json:"-"`
  1985. }
  1986. func (s *ProductAvailabilityChangeEvent) MarshalJSON() ([]byte, error) {
  1987. type NoMethod ProductAvailabilityChangeEvent
  1988. raw := NoMethod(*s)
  1989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1990. }
  1991. // ProductPermission: A product permissions resource represents the set
  1992. // of permissions required by a specific app and whether or not they
  1993. // have been accepted by an enterprise admin.
  1994. //
  1995. // The API can be used to read the set of permissions, and also to
  1996. // update the set to indicate that permissions have been accepted.
  1997. type ProductPermission struct {
  1998. // PermissionId: An opaque string uniquely identifying the permission.
  1999. PermissionId string `json:"permissionId,omitempty"`
  2000. // State: Whether the permission has been accepted or not.
  2001. State string `json:"state,omitempty"`
  2002. // ForceSendFields is a list of field names (e.g. "PermissionId") to
  2003. // unconditionally include in API requests. By default, fields with
  2004. // empty values are omitted from API requests. However, any non-pointer,
  2005. // non-interface field appearing in ForceSendFields will be sent to the
  2006. // server regardless of whether the field is empty or not. This may be
  2007. // used to include empty fields in Patch requests.
  2008. ForceSendFields []string `json:"-"`
  2009. // NullFields is a list of field names (e.g. "PermissionId") to include
  2010. // in API requests with the JSON null value. By default, fields with
  2011. // empty values are omitted from API requests. However, any field with
  2012. // an empty value appearing in NullFields will be sent to the server as
  2013. // null. It is an error if a field in this list has a non-empty value.
  2014. // This may be used to include null fields in Patch requests.
  2015. NullFields []string `json:"-"`
  2016. }
  2017. func (s *ProductPermission) MarshalJSON() ([]byte, error) {
  2018. type NoMethod ProductPermission
  2019. raw := NoMethod(*s)
  2020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2021. }
  2022. // ProductPermissions: Information about the permissions required by a
  2023. // specific app and whether they have been accepted by the enterprise.
  2024. type ProductPermissions struct {
  2025. // Kind: Identifies what kind of resource this is. Value: the fixed
  2026. // string "androidenterprise#productPermissions".
  2027. Kind string `json:"kind,omitempty"`
  2028. // Permission: The permissions required by the app.
  2029. Permission []*ProductPermission `json:"permission,omitempty"`
  2030. // ProductId: The ID of the app that the permissions relate to, e.g.
  2031. // "app:com.google.android.gm".
  2032. ProductId string `json:"productId,omitempty"`
  2033. // ServerResponse contains the HTTP response code and headers from the
  2034. // server.
  2035. googleapi.ServerResponse `json:"-"`
  2036. // ForceSendFields is a list of field names (e.g. "Kind") to
  2037. // unconditionally include in API requests. By default, fields with
  2038. // empty values are omitted from API requests. However, any non-pointer,
  2039. // non-interface field appearing in ForceSendFields will be sent to the
  2040. // server regardless of whether the field is empty or not. This may be
  2041. // used to include empty fields in Patch requests.
  2042. ForceSendFields []string `json:"-"`
  2043. // NullFields is a list of field names (e.g. "Kind") to include in API
  2044. // requests with the JSON null value. By default, fields with empty
  2045. // values are omitted from API requests. However, any field with an
  2046. // empty value appearing in NullFields will be sent to the server as
  2047. // null. It is an error if a field in this list has a non-empty value.
  2048. // This may be used to include null fields in Patch requests.
  2049. NullFields []string `json:"-"`
  2050. }
  2051. func (s *ProductPermissions) MarshalJSON() ([]byte, error) {
  2052. type NoMethod ProductPermissions
  2053. raw := NoMethod(*s)
  2054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2055. }
  2056. // ProductPolicy: The policy for a product.
  2057. type ProductPolicy struct {
  2058. // ProductId: The ID of the product. For example,
  2059. // "app:com.google.android.gm".
  2060. ProductId string `json:"productId,omitempty"`
  2061. // Tracks: Grants visibility to the specified track(s) of the product to
  2062. // the device. The track available to the device is based on the
  2063. // following order of preference: alpha, beta, production. For example,
  2064. // if an app has a prod version, a beta version and an alpha version and
  2065. // the enterprise has been granted visibility to both the alpha and beta
  2066. // tracks, if tracks is {"beta", "production"} then the beta version of
  2067. // the app is made available to the device. If there are no app versions
  2068. // in the specified track adding the "alpha" and "beta" values to the
  2069. // list of tracks will have no effect. Note that the enterprise requires
  2070. // access to alpha and/or beta tracks before users can be granted
  2071. // visibility to apps in those tracks.
  2072. //
  2073. // The allowed sets are: {} (considered equivalent to {"production"})
  2074. // {"production"} {"beta", "production"} {"alpha", "beta", "production"}
  2075. // The order of elements is not relevant. Any other set of tracks will
  2076. // be rejected with an error.
  2077. Tracks []string `json:"tracks,omitempty"`
  2078. // ForceSendFields is a list of field names (e.g. "ProductId") to
  2079. // unconditionally include in API requests. By default, fields with
  2080. // empty values are omitted from API requests. However, any non-pointer,
  2081. // non-interface field appearing in ForceSendFields will be sent to the
  2082. // server regardless of whether the field is empty or not. This may be
  2083. // used to include empty fields in Patch requests.
  2084. ForceSendFields []string `json:"-"`
  2085. // NullFields is a list of field names (e.g. "ProductId") to include in
  2086. // API requests with the JSON null value. By default, fields with empty
  2087. // values are omitted from API requests. However, any field with an
  2088. // empty value appearing in NullFields will be sent to the server as
  2089. // null. It is an error if a field in this list has a non-empty value.
  2090. // This may be used to include null fields in Patch requests.
  2091. NullFields []string `json:"-"`
  2092. }
  2093. func (s *ProductPolicy) MarshalJSON() ([]byte, error) {
  2094. type NoMethod ProductPolicy
  2095. raw := NoMethod(*s)
  2096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2097. }
  2098. // ProductSet: A set of products.
  2099. type ProductSet struct {
  2100. // Kind: Identifies what kind of resource this is. Value: the fixed
  2101. // string "androidenterprise#productSet".
  2102. Kind string `json:"kind,omitempty"`
  2103. // ProductId: The list of product IDs making up the set of products.
  2104. ProductId []string `json:"productId,omitempty"`
  2105. // ProductSetBehavior: The interpretation of this product set. "unknown"
  2106. // should never be sent and is ignored if received. "whitelist" means
  2107. // that the user is entitled to access the product set. "includeAll"
  2108. // means that all products are accessible, including products that are
  2109. // approved, products with revoked approval, and products that have
  2110. // never been approved. "allApproved" means that the user is entitled to
  2111. // access all products that are approved for the enterprise. If the
  2112. // value is "allApproved" or "includeAll", the productId field is
  2113. // ignored. If no value is provided, it is interpreted as "whitelist"
  2114. // for backwards compatibility. Further "allApproved" or "includeAll"
  2115. // does not enable automatic visibility of "alpha" or "beta" tracks for
  2116. // Android app. Use ProductVisibility to enable "alpha" or "beta" tracks
  2117. // per user.
  2118. ProductSetBehavior string `json:"productSetBehavior,omitempty"`
  2119. // ProductVisibility: Additional list of product IDs making up the
  2120. // product set. Unlike the productID array, in this list It's possible
  2121. // to specify which tracks (alpha, beta, production) of a product are
  2122. // visible to the user. See ProductVisibility and its fields for more
  2123. // information. Specifying the same product ID both here and in the
  2124. // productId array is not allowed and it will result in an error.
  2125. ProductVisibility []*ProductVisibility `json:"productVisibility,omitempty"`
  2126. // ServerResponse contains the HTTP response code and headers from the
  2127. // server.
  2128. googleapi.ServerResponse `json:"-"`
  2129. // ForceSendFields is a list of field names (e.g. "Kind") to
  2130. // unconditionally include in API requests. By default, fields with
  2131. // empty values are omitted from API requests. However, any non-pointer,
  2132. // non-interface field appearing in ForceSendFields will be sent to the
  2133. // server regardless of whether the field is empty or not. This may be
  2134. // used to include empty fields in Patch requests.
  2135. ForceSendFields []string `json:"-"`
  2136. // NullFields is a list of field names (e.g. "Kind") to include in API
  2137. // requests with the JSON null value. By default, fields with empty
  2138. // values are omitted from API requests. However, any field with an
  2139. // empty value appearing in NullFields will be sent to the server as
  2140. // null. It is an error if a field in this list has a non-empty value.
  2141. // This may be used to include null fields in Patch requests.
  2142. NullFields []string `json:"-"`
  2143. }
  2144. func (s *ProductSet) MarshalJSON() ([]byte, error) {
  2145. type NoMethod ProductSet
  2146. raw := NoMethod(*s)
  2147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2148. }
  2149. type ProductSigningCertificate struct {
  2150. // CertificateHashSha1: The base64 urlsafe encoded SHA1 hash of the
  2151. // certificate. (This field is deprecated in favor of SHA2-256. It
  2152. // should not be used and may be removed at any time.)
  2153. CertificateHashSha1 string `json:"certificateHashSha1,omitempty"`
  2154. // CertificateHashSha256: The base64 urlsafe encoded SHA2-256 hash of
  2155. // the certificate.
  2156. CertificateHashSha256 string `json:"certificateHashSha256,omitempty"`
  2157. // ForceSendFields is a list of field names (e.g. "CertificateHashSha1")
  2158. // to unconditionally include in API requests. By default, fields with
  2159. // empty values are omitted from API requests. However, any non-pointer,
  2160. // non-interface field appearing in ForceSendFields will be sent to the
  2161. // server regardless of whether the field is empty or not. This may be
  2162. // used to include empty fields in Patch requests.
  2163. ForceSendFields []string `json:"-"`
  2164. // NullFields is a list of field names (e.g. "CertificateHashSha1") to
  2165. // include in API requests with the JSON null value. By default, fields
  2166. // with empty values are omitted from API requests. However, any field
  2167. // with an empty value appearing in NullFields will be sent to the
  2168. // server as null. It is an error if a field in this list has a
  2169. // non-empty value. This may be used to include null fields in Patch
  2170. // requests.
  2171. NullFields []string `json:"-"`
  2172. }
  2173. func (s *ProductSigningCertificate) MarshalJSON() ([]byte, error) {
  2174. type NoMethod ProductSigningCertificate
  2175. raw := NoMethod(*s)
  2176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2177. }
  2178. // ProductVisibility: A product to be made visible to a user.
  2179. type ProductVisibility struct {
  2180. // ProductId: The product ID to make visible to the user. Required for
  2181. // each item in the productVisibility list.
  2182. ProductId string `json:"productId,omitempty"`
  2183. // Tracks: Grants visibility to the specified track(s) of the product to
  2184. // the user. The track available to the user is based on the following
  2185. // order of preference: alpha, beta, production. For example, if an app
  2186. // has a prod version, a beta version and an alpha version and the
  2187. // enterprise has been granted visibility to both the alpha and beta
  2188. // tracks, if tracks is {"beta", "production"} the user will be able to
  2189. // install the app and they will get the beta version of the app. If
  2190. // there are no app versions in the specified track adding the "alpha"
  2191. // and "beta" values to the list of tracks will have no effect. Note
  2192. // that the enterprise requires access to alpha and/or beta tracks
  2193. // before users can be granted visibility to apps in those tracks.
  2194. //
  2195. // The allowed sets are: {} (considered equivalent to {"production"})
  2196. // {"production"} {"beta", "production"} {"alpha", "beta", "production"}
  2197. // The order of elements is not relevant. Any other set of tracks will
  2198. // be rejected with an error.
  2199. Tracks []string `json:"tracks,omitempty"`
  2200. // ForceSendFields is a list of field names (e.g. "ProductId") to
  2201. // unconditionally include in API requests. By default, fields with
  2202. // empty values are omitted from API requests. However, any non-pointer,
  2203. // non-interface field appearing in ForceSendFields will be sent to the
  2204. // server regardless of whether the field is empty or not. This may be
  2205. // used to include empty fields in Patch requests.
  2206. ForceSendFields []string `json:"-"`
  2207. // NullFields is a list of field names (e.g. "ProductId") to include in
  2208. // API requests with the JSON null value. By default, fields with empty
  2209. // values are omitted from API requests. However, any field with an
  2210. // empty value appearing in NullFields will be sent to the server as
  2211. // null. It is an error if a field in this list has a non-empty value.
  2212. // This may be used to include null fields in Patch requests.
  2213. NullFields []string `json:"-"`
  2214. }
  2215. func (s *ProductVisibility) MarshalJSON() ([]byte, error) {
  2216. type NoMethod ProductVisibility
  2217. raw := NoMethod(*s)
  2218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2219. }
  2220. type ProductsApproveRequest struct {
  2221. // ApprovalUrlInfo: The approval URL that was shown to the user. Only
  2222. // the permissions shown to the user with that URL will be accepted,
  2223. // which may not be the product's entire set of permissions. For
  2224. // example, the URL may only display new permissions from an update
  2225. // after the product was approved, or not include new permissions if the
  2226. // product was updated since the URL was generated.
  2227. ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"`
  2228. // ApprovedPermissions: Sets how new permission requests for the product
  2229. // are handled. "allPermissions" automatically approves all current and
  2230. // future permissions for the product. "currentPermissionsOnly" approves
  2231. // the current set of permissions for the product, but any future
  2232. // permissions added through updates will require manual reapproval. If
  2233. // not specified, only the current set of permissions will be approved.
  2234. ApprovedPermissions string `json:"approvedPermissions,omitempty"`
  2235. // ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to
  2236. // unconditionally include in API requests. By default, fields with
  2237. // empty values are omitted from API requests. However, any non-pointer,
  2238. // non-interface field appearing in ForceSendFields will be sent to the
  2239. // server regardless of whether the field is empty or not. This may be
  2240. // used to include empty fields in Patch requests.
  2241. ForceSendFields []string `json:"-"`
  2242. // NullFields is a list of field names (e.g. "ApprovalUrlInfo") to
  2243. // include in API requests with the JSON null value. By default, fields
  2244. // with empty values are omitted from API requests. However, any field
  2245. // with an empty value appearing in NullFields will be sent to the
  2246. // server as null. It is an error if a field in this list has a
  2247. // non-empty value. This may be used to include null fields in Patch
  2248. // requests.
  2249. NullFields []string `json:"-"`
  2250. }
  2251. func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) {
  2252. type NoMethod ProductsApproveRequest
  2253. raw := NoMethod(*s)
  2254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2255. }
  2256. type ProductsGenerateApprovalUrlResponse struct {
  2257. // Url: A URL that can be rendered in an iframe to display the
  2258. // permissions (if any) of a product. This URL can be used to approve
  2259. // the product only once and only within 24 hours of being generated,
  2260. // using the Products.approve call. If the product is currently
  2261. // unapproved and has no permissions, this URL will point to an empty
  2262. // page. If the product is currently approved, a URL will only be
  2263. // generated if that product has added permissions since it was last
  2264. // approved, and the URL will only display those new permissions that
  2265. // have not yet been accepted.
  2266. Url string `json:"url,omitempty"`
  2267. // ServerResponse contains the HTTP response code and headers from the
  2268. // server.
  2269. googleapi.ServerResponse `json:"-"`
  2270. // ForceSendFields is a list of field names (e.g. "Url") to
  2271. // unconditionally include in API requests. By default, fields with
  2272. // empty values are omitted from API requests. However, any non-pointer,
  2273. // non-interface field appearing in ForceSendFields will be sent to the
  2274. // server regardless of whether the field is empty or not. This may be
  2275. // used to include empty fields in Patch requests.
  2276. ForceSendFields []string `json:"-"`
  2277. // NullFields is a list of field names (e.g. "Url") to include in API
  2278. // requests with the JSON null value. By default, fields with empty
  2279. // values are omitted from API requests. However, any field with an
  2280. // empty value appearing in NullFields will be sent to the server as
  2281. // null. It is an error if a field in this list has a non-empty value.
  2282. // This may be used to include null fields in Patch requests.
  2283. NullFields []string `json:"-"`
  2284. }
  2285. func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) {
  2286. type NoMethod ProductsGenerateApprovalUrlResponse
  2287. raw := NoMethod(*s)
  2288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2289. }
  2290. // ProductsListResponse: The matching products.
  2291. type ProductsListResponse struct {
  2292. // Kind: Identifies what kind of resource this is. Value: the fixed
  2293. // string "androidenterprise#productsListResponse".
  2294. Kind string `json:"kind,omitempty"`
  2295. // PageInfo: General pagination information.
  2296. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2297. // Product: Information about a product (e.g. an app) in the Google Play
  2298. // store, for display to an enterprise admin.
  2299. Product []*Product `json:"product,omitempty"`
  2300. // TokenPagination: Pagination information for token pagination.
  2301. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2302. // ServerResponse contains the HTTP response code and headers from the
  2303. // server.
  2304. googleapi.ServerResponse `json:"-"`
  2305. // ForceSendFields is a list of field names (e.g. "Kind") to
  2306. // unconditionally include in API requests. By default, fields with
  2307. // empty values are omitted from API requests. However, any non-pointer,
  2308. // non-interface field appearing in ForceSendFields will be sent to the
  2309. // server regardless of whether the field is empty or not. This may be
  2310. // used to include empty fields in Patch requests.
  2311. ForceSendFields []string `json:"-"`
  2312. // NullFields is a list of field names (e.g. "Kind") to include in API
  2313. // requests with the JSON null value. By default, fields with empty
  2314. // values are omitted from API requests. However, any field with an
  2315. // empty value appearing in NullFields will be sent to the server as
  2316. // null. It is an error if a field in this list has a non-empty value.
  2317. // This may be used to include null fields in Patch requests.
  2318. NullFields []string `json:"-"`
  2319. }
  2320. func (s *ProductsListResponse) MarshalJSON() ([]byte, error) {
  2321. type NoMethod ProductsListResponse
  2322. raw := NoMethod(*s)
  2323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2324. }
  2325. // ServiceAccount: A service account identity, including the name and
  2326. // credentials that can be used to authenticate as the service account.
  2327. type ServiceAccount struct {
  2328. // Key: Credentials that can be used to authenticate as this
  2329. // ServiceAccount.
  2330. Key *ServiceAccountKey `json:"key,omitempty"`
  2331. // Kind: Identifies what kind of resource this is. Value: the fixed
  2332. // string "androidenterprise#serviceAccount".
  2333. Kind string `json:"kind,omitempty"`
  2334. // Name: The account name of the service account, in the form of an
  2335. // email address. Assigned by the server.
  2336. Name string `json:"name,omitempty"`
  2337. // ServerResponse contains the HTTP response code and headers from the
  2338. // server.
  2339. googleapi.ServerResponse `json:"-"`
  2340. // ForceSendFields is a list of field names (e.g. "Key") to
  2341. // unconditionally include in API requests. By default, fields with
  2342. // empty values are omitted from API requests. However, any non-pointer,
  2343. // non-interface field appearing in ForceSendFields will be sent to the
  2344. // server regardless of whether the field is empty or not. This may be
  2345. // used to include empty fields in Patch requests.
  2346. ForceSendFields []string `json:"-"`
  2347. // NullFields is a list of field names (e.g. "Key") to include in API
  2348. // requests with the JSON null value. By default, fields with empty
  2349. // values are omitted from API requests. However, any field with an
  2350. // empty value appearing in NullFields will be sent to the server as
  2351. // null. It is an error if a field in this list has a non-empty value.
  2352. // This may be used to include null fields in Patch requests.
  2353. NullFields []string `json:"-"`
  2354. }
  2355. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  2356. type NoMethod ServiceAccount
  2357. raw := NoMethod(*s)
  2358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2359. }
  2360. // ServiceAccountKey: Credentials that can be used to authenticate as a
  2361. // service account.
  2362. type ServiceAccountKey struct {
  2363. // Data: The body of the private key credentials file, in string format.
  2364. // This is only populated when the ServiceAccountKey is created, and is
  2365. // not stored by Google.
  2366. Data string `json:"data,omitempty"`
  2367. // Id: An opaque, unique identifier for this ServiceAccountKey. Assigned
  2368. // by the server.
  2369. Id string `json:"id,omitempty"`
  2370. // Kind: Identifies what kind of resource this is. Value: the fixed
  2371. // string "androidenterprise#serviceAccountKey".
  2372. Kind string `json:"kind,omitempty"`
  2373. // PublicData: Public key data for the credentials file. This is an
  2374. // X.509 cert. If you are using the googleCredentials key type, this is
  2375. // identical to the cert that can be retrieved by using the X.509 cert
  2376. // url inside of the credentials file.
  2377. PublicData string `json:"publicData,omitempty"`
  2378. // Type: The file format of the generated key data.
  2379. Type string `json:"type,omitempty"`
  2380. // ServerResponse contains the HTTP response code and headers from the
  2381. // server.
  2382. googleapi.ServerResponse `json:"-"`
  2383. // ForceSendFields is a list of field names (e.g. "Data") to
  2384. // unconditionally include in API requests. By default, fields with
  2385. // empty values are omitted from API requests. However, any non-pointer,
  2386. // non-interface field appearing in ForceSendFields will be sent to the
  2387. // server regardless of whether the field is empty or not. This may be
  2388. // used to include empty fields in Patch requests.
  2389. ForceSendFields []string `json:"-"`
  2390. // NullFields is a list of field names (e.g. "Data") to include in API
  2391. // requests with the JSON null value. By default, fields with empty
  2392. // values are omitted from API requests. However, any field with an
  2393. // empty value appearing in NullFields will be sent to the server as
  2394. // null. It is an error if a field in this list has a non-empty value.
  2395. // This may be used to include null fields in Patch requests.
  2396. NullFields []string `json:"-"`
  2397. }
  2398. func (s *ServiceAccountKey) MarshalJSON() ([]byte, error) {
  2399. type NoMethod ServiceAccountKey
  2400. raw := NoMethod(*s)
  2401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2402. }
  2403. type ServiceAccountKeysListResponse struct {
  2404. // ServiceAccountKey: The service account credentials.
  2405. ServiceAccountKey []*ServiceAccountKey `json:"serviceAccountKey,omitempty"`
  2406. // ServerResponse contains the HTTP response code and headers from the
  2407. // server.
  2408. googleapi.ServerResponse `json:"-"`
  2409. // ForceSendFields is a list of field names (e.g. "ServiceAccountKey")
  2410. // to unconditionally include in API requests. By default, fields with
  2411. // empty values are omitted from API requests. However, any non-pointer,
  2412. // non-interface field appearing in ForceSendFields will be sent to the
  2413. // server regardless of whether the field is empty or not. This may be
  2414. // used to include empty fields in Patch requests.
  2415. ForceSendFields []string `json:"-"`
  2416. // NullFields is a list of field names (e.g. "ServiceAccountKey") to
  2417. // include in API requests with the JSON null value. By default, fields
  2418. // with empty values are omitted from API requests. However, any field
  2419. // with an empty value appearing in NullFields will be sent to the
  2420. // server as null. It is an error if a field in this list has a
  2421. // non-empty value. This may be used to include null fields in Patch
  2422. // requests.
  2423. NullFields []string `json:"-"`
  2424. }
  2425. func (s *ServiceAccountKeysListResponse) MarshalJSON() ([]byte, error) {
  2426. type NoMethod ServiceAccountKeysListResponse
  2427. raw := NoMethod(*s)
  2428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2429. }
  2430. // SignupInfo: A resource returned by the GenerateSignupUrl API, which
  2431. // contains the Signup URL and Completion Token.
  2432. type SignupInfo struct {
  2433. // CompletionToken: An opaque token that will be required, along with
  2434. // the Enterprise Token, for obtaining the enterprise resource from
  2435. // CompleteSignup.
  2436. CompletionToken string `json:"completionToken,omitempty"`
  2437. // Kind: Identifies what kind of resource this is. Value: the fixed
  2438. // string "androidenterprise#signupInfo".
  2439. Kind string `json:"kind,omitempty"`
  2440. // Url: A URL under which the Admin can sign up for an enterprise. The
  2441. // page pointed to cannot be rendered in an iframe.
  2442. Url string `json:"url,omitempty"`
  2443. // ServerResponse contains the HTTP response code and headers from the
  2444. // server.
  2445. googleapi.ServerResponse `json:"-"`
  2446. // ForceSendFields is a list of field names (e.g. "CompletionToken") to
  2447. // unconditionally include in API requests. By default, fields with
  2448. // empty values are omitted from API requests. However, any non-pointer,
  2449. // non-interface field appearing in ForceSendFields will be sent to the
  2450. // server regardless of whether the field is empty or not. This may be
  2451. // used to include empty fields in Patch requests.
  2452. ForceSendFields []string `json:"-"`
  2453. // NullFields is a list of field names (e.g. "CompletionToken") to
  2454. // include in API requests with the JSON null value. By default, fields
  2455. // with empty values are omitted from API requests. However, any field
  2456. // with an empty value appearing in NullFields will be sent to the
  2457. // server as null. It is an error if a field in this list has a
  2458. // non-empty value. This may be used to include null fields in Patch
  2459. // requests.
  2460. NullFields []string `json:"-"`
  2461. }
  2462. func (s *SignupInfo) MarshalJSON() ([]byte, error) {
  2463. type NoMethod SignupInfo
  2464. raw := NoMethod(*s)
  2465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2466. }
  2467. // StoreCluster: Definition of a managed Google Play store cluster, a
  2468. // list of products displayed as part of a store page.
  2469. type StoreCluster struct {
  2470. // Id: Unique ID of this cluster. Assigned by the server. Immutable once
  2471. // assigned.
  2472. Id string `json:"id,omitempty"`
  2473. // Kind: Identifies what kind of resource this is. Value: the fixed
  2474. // string "androidenterprise#storeCluster".
  2475. Kind string `json:"kind,omitempty"`
  2476. // Name: Ordered list of localized strings giving the name of this page.
  2477. // The text displayed is the one that best matches the user locale, or
  2478. // the first entry if there is no good match. There needs to be at least
  2479. // one entry.
  2480. Name []*LocalizedText `json:"name,omitempty"`
  2481. // OrderInPage: String (US-ASCII only) used to determine order of this
  2482. // cluster within the parent page's elements. Page elements are sorted
  2483. // in lexicographic order of this field. Duplicated values are allowed,
  2484. // but ordering between elements with duplicate order is undefined.
  2485. //
  2486. // The value of this field is never visible to a user, it is used solely
  2487. // for the purpose of defining an ordering. Maximum length is 256
  2488. // characters.
  2489. OrderInPage string `json:"orderInPage,omitempty"`
  2490. // ProductId: List of products in the order they are displayed in the
  2491. // cluster. There should not be duplicates within a cluster.
  2492. ProductId []string `json:"productId,omitempty"`
  2493. // ServerResponse contains the HTTP response code and headers from the
  2494. // server.
  2495. googleapi.ServerResponse `json:"-"`
  2496. // ForceSendFields is a list of field names (e.g. "Id") to
  2497. // unconditionally include in API requests. By default, fields with
  2498. // empty values are omitted from API requests. However, any non-pointer,
  2499. // non-interface field appearing in ForceSendFields will be sent to the
  2500. // server regardless of whether the field is empty or not. This may be
  2501. // used to include empty fields in Patch requests.
  2502. ForceSendFields []string `json:"-"`
  2503. // NullFields is a list of field names (e.g. "Id") to include in API
  2504. // requests with the JSON null value. By default, fields with empty
  2505. // values are omitted from API requests. However, any field with an
  2506. // empty value appearing in NullFields will be sent to the server as
  2507. // null. It is an error if a field in this list has a non-empty value.
  2508. // This may be used to include null fields in Patch requests.
  2509. NullFields []string `json:"-"`
  2510. }
  2511. func (s *StoreCluster) MarshalJSON() ([]byte, error) {
  2512. type NoMethod StoreCluster
  2513. raw := NoMethod(*s)
  2514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2515. }
  2516. // StoreLayout: General setting for the managed Google Play store
  2517. // layout, currently only specifying the page to display the first time
  2518. // the store is opened.
  2519. type StoreLayout struct {
  2520. // HomepageId: The ID of the store page to be used as the homepage. The
  2521. // homepage is the first page shown in the managed Google Play
  2522. // Store.
  2523. //
  2524. // Not specifying a homepage is equivalent to setting the store layout
  2525. // type to "basic".
  2526. HomepageId string `json:"homepageId,omitempty"`
  2527. // Kind: Identifies what kind of resource this is. Value: the fixed
  2528. // string "androidenterprise#storeLayout".
  2529. Kind string `json:"kind,omitempty"`
  2530. // StoreLayoutType: The store layout type. By default, this value is set
  2531. // to "basic" if the homepageId field is not set, and to "custom"
  2532. // otherwise. If set to "basic", the layout will consist of all approved
  2533. // apps that have been whitelisted for the user.
  2534. StoreLayoutType string `json:"storeLayoutType,omitempty"`
  2535. // ServerResponse contains the HTTP response code and headers from the
  2536. // server.
  2537. googleapi.ServerResponse `json:"-"`
  2538. // ForceSendFields is a list of field names (e.g. "HomepageId") to
  2539. // unconditionally include in API requests. By default, fields with
  2540. // empty values are omitted from API requests. However, any non-pointer,
  2541. // non-interface field appearing in ForceSendFields will be sent to the
  2542. // server regardless of whether the field is empty or not. This may be
  2543. // used to include empty fields in Patch requests.
  2544. ForceSendFields []string `json:"-"`
  2545. // NullFields is a list of field names (e.g. "HomepageId") to include in
  2546. // API requests with the JSON null value. By default, fields with empty
  2547. // values are omitted from API requests. However, any field with an
  2548. // empty value appearing in NullFields will be sent to the server as
  2549. // null. It is an error if a field in this list has a non-empty value.
  2550. // This may be used to include null fields in Patch requests.
  2551. NullFields []string `json:"-"`
  2552. }
  2553. func (s *StoreLayout) MarshalJSON() ([]byte, error) {
  2554. type NoMethod StoreLayout
  2555. raw := NoMethod(*s)
  2556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2557. }
  2558. // StoreLayoutClustersListResponse: The store page resources for the
  2559. // enterprise.
  2560. type StoreLayoutClustersListResponse struct {
  2561. // Cluster: A store cluster of an enterprise.
  2562. Cluster []*StoreCluster `json:"cluster,omitempty"`
  2563. // Kind: Identifies what kind of resource this is. Value: the fixed
  2564. // string "androidenterprise#storeLayoutClustersListResponse".
  2565. Kind string `json:"kind,omitempty"`
  2566. // ServerResponse contains the HTTP response code and headers from the
  2567. // server.
  2568. googleapi.ServerResponse `json:"-"`
  2569. // ForceSendFields is a list of field names (e.g. "Cluster") to
  2570. // unconditionally include in API requests. By default, fields with
  2571. // empty values are omitted from API requests. However, any non-pointer,
  2572. // non-interface field appearing in ForceSendFields will be sent to the
  2573. // server regardless of whether the field is empty or not. This may be
  2574. // used to include empty fields in Patch requests.
  2575. ForceSendFields []string `json:"-"`
  2576. // NullFields is a list of field names (e.g. "Cluster") to include in
  2577. // API requests with the JSON null value. By default, fields with empty
  2578. // values are omitted from API requests. However, any field with an
  2579. // empty value appearing in NullFields will be sent to the server as
  2580. // null. It is an error if a field in this list has a non-empty value.
  2581. // This may be used to include null fields in Patch requests.
  2582. NullFields []string `json:"-"`
  2583. }
  2584. func (s *StoreLayoutClustersListResponse) MarshalJSON() ([]byte, error) {
  2585. type NoMethod StoreLayoutClustersListResponse
  2586. raw := NoMethod(*s)
  2587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2588. }
  2589. // StoreLayoutPagesListResponse: The store page resources for the
  2590. // enterprise.
  2591. type StoreLayoutPagesListResponse struct {
  2592. // Kind: Identifies what kind of resource this is. Value: the fixed
  2593. // string "androidenterprise#storeLayoutPagesListResponse".
  2594. Kind string `json:"kind,omitempty"`
  2595. // Page: A store page of an enterprise.
  2596. Page []*StorePage `json:"page,omitempty"`
  2597. // ServerResponse contains the HTTP response code and headers from the
  2598. // server.
  2599. googleapi.ServerResponse `json:"-"`
  2600. // ForceSendFields is a list of field names (e.g. "Kind") to
  2601. // unconditionally include in API requests. By default, fields with
  2602. // empty values are omitted from API requests. However, any non-pointer,
  2603. // non-interface field appearing in ForceSendFields will be sent to the
  2604. // server regardless of whether the field is empty or not. This may be
  2605. // used to include empty fields in Patch requests.
  2606. ForceSendFields []string `json:"-"`
  2607. // NullFields is a list of field names (e.g. "Kind") to include in API
  2608. // requests with the JSON null value. By default, fields with empty
  2609. // values are omitted from API requests. However, any field with an
  2610. // empty value appearing in NullFields will be sent to the server as
  2611. // null. It is an error if a field in this list has a non-empty value.
  2612. // This may be used to include null fields in Patch requests.
  2613. NullFields []string `json:"-"`
  2614. }
  2615. func (s *StoreLayoutPagesListResponse) MarshalJSON() ([]byte, error) {
  2616. type NoMethod StoreLayoutPagesListResponse
  2617. raw := NoMethod(*s)
  2618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2619. }
  2620. // StorePage: Definition of a managed Google Play store page, made of a
  2621. // localized name and links to other pages. A page also contains
  2622. // clusters defined as a subcollection.
  2623. type StorePage struct {
  2624. // Id: Unique ID of this page. Assigned by the server. Immutable once
  2625. // assigned.
  2626. Id string `json:"id,omitempty"`
  2627. // Kind: Identifies what kind of resource this is. Value: the fixed
  2628. // string "androidenterprise#storePage".
  2629. Kind string `json:"kind,omitempty"`
  2630. // Link: Ordered list of pages a user should be able to reach from this
  2631. // page. The pages must exist, must not be this page, and once a link is
  2632. // created the page linked to cannot be deleted until all links to it
  2633. // are removed. It is recommended that the basic pages are created
  2634. // first, before adding the links between pages.
  2635. //
  2636. // No attempt is made to verify that all pages are reachable from the
  2637. // homepage.
  2638. Link []string `json:"link,omitempty"`
  2639. // Name: Ordered list of localized strings giving the name of this page.
  2640. // The text displayed is the one that best matches the user locale, or
  2641. // the first entry if there is no good match. There needs to be at least
  2642. // one entry.
  2643. Name []*LocalizedText `json:"name,omitempty"`
  2644. // ServerResponse contains the HTTP response code and headers from the
  2645. // server.
  2646. googleapi.ServerResponse `json:"-"`
  2647. // ForceSendFields is a list of field names (e.g. "Id") to
  2648. // unconditionally include in API requests. By default, fields with
  2649. // empty values are omitted from API requests. However, any non-pointer,
  2650. // non-interface field appearing in ForceSendFields will be sent to the
  2651. // server regardless of whether the field is empty or not. This may be
  2652. // used to include empty fields in Patch requests.
  2653. ForceSendFields []string `json:"-"`
  2654. // NullFields is a list of field names (e.g. "Id") to include in API
  2655. // requests with the JSON null value. By default, fields with empty
  2656. // values are omitted from API requests. However, any field with an
  2657. // empty value appearing in NullFields will be sent to the server as
  2658. // null. It is an error if a field in this list has a non-empty value.
  2659. // This may be used to include null fields in Patch requests.
  2660. NullFields []string `json:"-"`
  2661. }
  2662. func (s *StorePage) MarshalJSON() ([]byte, error) {
  2663. type NoMethod StorePage
  2664. raw := NoMethod(*s)
  2665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2666. }
  2667. type TokenPagination struct {
  2668. NextPageToken string `json:"nextPageToken,omitempty"`
  2669. PreviousPageToken string `json:"previousPageToken,omitempty"`
  2670. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2671. // unconditionally include in API requests. By default, fields with
  2672. // empty values are omitted from API requests. However, any non-pointer,
  2673. // non-interface field appearing in ForceSendFields will be sent to the
  2674. // server regardless of whether the field is empty or not. This may be
  2675. // used to include empty fields in Patch requests.
  2676. ForceSendFields []string `json:"-"`
  2677. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2678. // in API requests with the JSON null value. By default, fields with
  2679. // empty values are omitted from API requests. However, any field with
  2680. // an empty value appearing in NullFields will be sent to the server as
  2681. // null. It is an error if a field in this list has a non-empty value.
  2682. // This may be used to include null fields in Patch requests.
  2683. NullFields []string `json:"-"`
  2684. }
  2685. func (s *TokenPagination) MarshalJSON() ([]byte, error) {
  2686. type NoMethod TokenPagination
  2687. raw := NoMethod(*s)
  2688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2689. }
  2690. // User: A Users resource represents an account associated with an
  2691. // enterprise. The account may be specific to a device or to an
  2692. // individual user (who can then use the account across multiple
  2693. // devices). The account may provide access to managed Google Play only,
  2694. // or to other Google services, depending on the identity model:
  2695. // - The Google managed domain identity model requires synchronization
  2696. // to Google account sources (via primaryEmail).
  2697. // - The managed Google Play Accounts identity model provides a dynamic
  2698. // means for enterprises to create user or device accounts as needed.
  2699. // These accounts provide access to managed Google Play.
  2700. type User struct {
  2701. // AccountIdentifier: A unique identifier you create for this user, such
  2702. // as "user342" or "asset#44418". Do not use personally identifiable
  2703. // information (PII) for this property. Must always be set for
  2704. // EMM-managed users. Not set for Google-managed users.
  2705. AccountIdentifier string `json:"accountIdentifier,omitempty"`
  2706. // AccountType: The type of account that this user represents. A
  2707. // userAccount can be installed on multiple devices, but a deviceAccount
  2708. // is specific to a single device. An EMM-managed user (emmManaged) can
  2709. // be either type (userAccount, deviceAccount), but a Google-managed
  2710. // user (googleManaged) is always a userAccount.
  2711. AccountType string `json:"accountType,omitempty"`
  2712. // DisplayName: The name that will appear in user interfaces. Setting
  2713. // this property is optional when creating EMM-managed users. If you do
  2714. // set this property, use something generic about the organization (such
  2715. // as "Example, Inc.") or your name (as EMM). Not used for
  2716. // Google-managed user accounts.
  2717. DisplayName string `json:"displayName,omitempty"`
  2718. // Id: The unique ID for the user.
  2719. Id string `json:"id,omitempty"`
  2720. // Kind: Identifies what kind of resource this is. Value: the fixed
  2721. // string "androidenterprise#user".
  2722. Kind string `json:"kind,omitempty"`
  2723. // ManagementType: The entity that manages the user. With googleManaged
  2724. // users, the source of truth is Google so EMMs have to make sure a
  2725. // Google Account exists for the user. With emmManaged users, the EMM is
  2726. // in charge.
  2727. ManagementType string `json:"managementType,omitempty"`
  2728. // PrimaryEmail: The user's primary email address, for example,
  2729. // "jsmith@example.com". Will always be set for Google managed users and
  2730. // not set for EMM managed users.
  2731. PrimaryEmail string `json:"primaryEmail,omitempty"`
  2732. // ServerResponse contains the HTTP response code and headers from the
  2733. // server.
  2734. googleapi.ServerResponse `json:"-"`
  2735. // ForceSendFields is a list of field names (e.g. "AccountIdentifier")
  2736. // to unconditionally include in API requests. By default, fields with
  2737. // empty values are omitted from API requests. However, any non-pointer,
  2738. // non-interface field appearing in ForceSendFields will be sent to the
  2739. // server regardless of whether the field is empty or not. This may be
  2740. // used to include empty fields in Patch requests.
  2741. ForceSendFields []string `json:"-"`
  2742. // NullFields is a list of field names (e.g. "AccountIdentifier") to
  2743. // include in API requests with the JSON null value. By default, fields
  2744. // with empty values are omitted from API requests. However, any field
  2745. // with an empty value appearing in NullFields will be sent to the
  2746. // server as null. It is an error if a field in this list has a
  2747. // non-empty value. This may be used to include null fields in Patch
  2748. // requests.
  2749. NullFields []string `json:"-"`
  2750. }
  2751. func (s *User) MarshalJSON() ([]byte, error) {
  2752. type NoMethod User
  2753. raw := NoMethod(*s)
  2754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2755. }
  2756. // UserToken: A UserToken is used by a user when setting up a managed
  2757. // device or profile with their managed Google Play account on a device.
  2758. // When the user enters their email address and token (activation code)
  2759. // the appropriate EMM app can be automatically downloaded.
  2760. type UserToken struct {
  2761. // Kind: Identifies what kind of resource this is. Value: the fixed
  2762. // string "androidenterprise#userToken".
  2763. Kind string `json:"kind,omitempty"`
  2764. // Token: The token (activation code) to be entered by the user. This
  2765. // consists of a sequence of decimal digits. Note that the leading digit
  2766. // may be 0.
  2767. Token string `json:"token,omitempty"`
  2768. // UserId: The unique ID for the user.
  2769. UserId string `json:"userId,omitempty"`
  2770. // ServerResponse contains the HTTP response code and headers from the
  2771. // server.
  2772. googleapi.ServerResponse `json:"-"`
  2773. // ForceSendFields is a list of field names (e.g. "Kind") to
  2774. // unconditionally include in API requests. By default, fields with
  2775. // empty values are omitted from API requests. However, any non-pointer,
  2776. // non-interface field appearing in ForceSendFields will be sent to the
  2777. // server regardless of whether the field is empty or not. This may be
  2778. // used to include empty fields in Patch requests.
  2779. ForceSendFields []string `json:"-"`
  2780. // NullFields is a list of field names (e.g. "Kind") to include in API
  2781. // requests with the JSON null value. By default, fields with empty
  2782. // values are omitted from API requests. However, any field with an
  2783. // empty value appearing in NullFields will be sent to the server as
  2784. // null. It is an error if a field in this list has a non-empty value.
  2785. // This may be used to include null fields in Patch requests.
  2786. NullFields []string `json:"-"`
  2787. }
  2788. func (s *UserToken) MarshalJSON() ([]byte, error) {
  2789. type NoMethod UserToken
  2790. raw := NoMethod(*s)
  2791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2792. }
  2793. // UsersListResponse: The matching user resources.
  2794. type UsersListResponse struct {
  2795. // Kind: Identifies what kind of resource this is. Value: the fixed
  2796. // string "androidenterprise#usersListResponse".
  2797. Kind string `json:"kind,omitempty"`
  2798. // User: A user of an enterprise.
  2799. User []*User `json:"user,omitempty"`
  2800. // ServerResponse contains the HTTP response code and headers from the
  2801. // server.
  2802. googleapi.ServerResponse `json:"-"`
  2803. // ForceSendFields is a list of field names (e.g. "Kind") to
  2804. // unconditionally include in API requests. By default, fields with
  2805. // empty values are omitted from API requests. However, any non-pointer,
  2806. // non-interface field appearing in ForceSendFields will be sent to the
  2807. // server regardless of whether the field is empty or not. This may be
  2808. // used to include empty fields in Patch requests.
  2809. ForceSendFields []string `json:"-"`
  2810. // NullFields is a list of field names (e.g. "Kind") to include in API
  2811. // requests with the JSON null value. By default, fields with empty
  2812. // values are omitted from API requests. However, any field with an
  2813. // empty value appearing in NullFields will be sent to the server as
  2814. // null. It is an error if a field in this list has a non-empty value.
  2815. // This may be used to include null fields in Patch requests.
  2816. NullFields []string `json:"-"`
  2817. }
  2818. func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
  2819. type NoMethod UsersListResponse
  2820. raw := NoMethod(*s)
  2821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2822. }
  2823. // VariableSet: A variable set is a key-value pair of EMM-provided
  2824. // placeholders and its corresponding value, which is attributed to a
  2825. // user. For example, $FIRSTNAME could be a placeholder, and its value
  2826. // could be Alice. Placeholders should start with a '$' sign and should
  2827. // be alphanumeric only.
  2828. type VariableSet struct {
  2829. // Kind: Identifies what kind of resource this is. Value: the fixed
  2830. // string "androidenterprise#variableSet".
  2831. Kind string `json:"kind,omitempty"`
  2832. // Placeholder: The placeholder string; defined by EMM.
  2833. Placeholder string `json:"placeholder,omitempty"`
  2834. // UserValue: The value of the placeholder, specific to the user.
  2835. UserValue string `json:"userValue,omitempty"`
  2836. // ForceSendFields is a list of field names (e.g. "Kind") to
  2837. // unconditionally include in API requests. By default, fields with
  2838. // empty values are omitted from API requests. However, any non-pointer,
  2839. // non-interface field appearing in ForceSendFields will be sent to the
  2840. // server regardless of whether the field is empty or not. This may be
  2841. // used to include empty fields in Patch requests.
  2842. ForceSendFields []string `json:"-"`
  2843. // NullFields is a list of field names (e.g. "Kind") to include in API
  2844. // requests with the JSON null value. By default, fields with empty
  2845. // values are omitted from API requests. However, any field with an
  2846. // empty value appearing in NullFields will be sent to the server as
  2847. // null. It is an error if a field in this list has a non-empty value.
  2848. // This may be used to include null fields in Patch requests.
  2849. NullFields []string `json:"-"`
  2850. }
  2851. func (s *VariableSet) MarshalJSON() ([]byte, error) {
  2852. type NoMethod VariableSet
  2853. raw := NoMethod(*s)
  2854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2855. }
  2856. // method id "androidenterprise.devices.get":
  2857. type DevicesGetCall struct {
  2858. s *Service
  2859. enterpriseId string
  2860. userId string
  2861. deviceId string
  2862. urlParams_ gensupport.URLParams
  2863. ifNoneMatch_ string
  2864. ctx_ context.Context
  2865. header_ http.Header
  2866. }
  2867. // Get: Retrieves the details of a device.
  2868. func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall {
  2869. c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2870. c.enterpriseId = enterpriseId
  2871. c.userId = userId
  2872. c.deviceId = deviceId
  2873. return c
  2874. }
  2875. // Fields allows partial responses to be retrieved. See
  2876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2877. // for more information.
  2878. func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall {
  2879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2880. return c
  2881. }
  2882. // IfNoneMatch sets the optional parameter which makes the operation
  2883. // fail if the object's ETag matches the given value. This is useful for
  2884. // getting updates only after the object has changed since the last
  2885. // request. Use googleapi.IsNotModified to check whether the response
  2886. // error from Do is the result of In-None-Match.
  2887. func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall {
  2888. c.ifNoneMatch_ = entityTag
  2889. return c
  2890. }
  2891. // Context sets the context to be used in this call's Do method. Any
  2892. // pending HTTP request will be aborted if the provided context is
  2893. // canceled.
  2894. func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall {
  2895. c.ctx_ = ctx
  2896. return c
  2897. }
  2898. // Header returns an http.Header that can be modified by the caller to
  2899. // add HTTP headers to the request.
  2900. func (c *DevicesGetCall) Header() http.Header {
  2901. if c.header_ == nil {
  2902. c.header_ = make(http.Header)
  2903. }
  2904. return c.header_
  2905. }
  2906. func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) {
  2907. reqHeaders := make(http.Header)
  2908. for k, v := range c.header_ {
  2909. reqHeaders[k] = v
  2910. }
  2911. reqHeaders.Set("User-Agent", c.s.userAgent())
  2912. if c.ifNoneMatch_ != "" {
  2913. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2914. }
  2915. var body io.Reader = nil
  2916. c.urlParams_.Set("alt", alt)
  2917. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
  2918. urls += "?" + c.urlParams_.Encode()
  2919. req, _ := http.NewRequest("GET", urls, body)
  2920. req.Header = reqHeaders
  2921. googleapi.Expand(req.URL, map[string]string{
  2922. "enterpriseId": c.enterpriseId,
  2923. "userId": c.userId,
  2924. "deviceId": c.deviceId,
  2925. })
  2926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2927. }
  2928. // Do executes the "androidenterprise.devices.get" call.
  2929. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  2930. // code is an error. Response headers are in either
  2931. // *Device.ServerResponse.Header or (if a response was returned at all)
  2932. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2933. // check whether the returned error was because http.StatusNotModified
  2934. // was returned.
  2935. func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  2936. gensupport.SetOptions(c.urlParams_, opts...)
  2937. res, err := c.doRequest("json")
  2938. if res != nil && res.StatusCode == http.StatusNotModified {
  2939. if res.Body != nil {
  2940. res.Body.Close()
  2941. }
  2942. return nil, &googleapi.Error{
  2943. Code: res.StatusCode,
  2944. Header: res.Header,
  2945. }
  2946. }
  2947. if err != nil {
  2948. return nil, err
  2949. }
  2950. defer googleapi.CloseBody(res)
  2951. if err := googleapi.CheckResponse(res); err != nil {
  2952. return nil, err
  2953. }
  2954. ret := &Device{
  2955. ServerResponse: googleapi.ServerResponse{
  2956. Header: res.Header,
  2957. HTTPStatusCode: res.StatusCode,
  2958. },
  2959. }
  2960. target := &ret
  2961. if err := gensupport.DecodeResponse(target, res); err != nil {
  2962. return nil, err
  2963. }
  2964. return ret, nil
  2965. // {
  2966. // "description": "Retrieves the details of a device.",
  2967. // "httpMethod": "GET",
  2968. // "id": "androidenterprise.devices.get",
  2969. // "parameterOrder": [
  2970. // "enterpriseId",
  2971. // "userId",
  2972. // "deviceId"
  2973. // ],
  2974. // "parameters": {
  2975. // "deviceId": {
  2976. // "description": "The ID of the device.",
  2977. // "location": "path",
  2978. // "required": true,
  2979. // "type": "string"
  2980. // },
  2981. // "enterpriseId": {
  2982. // "description": "The ID of the enterprise.",
  2983. // "location": "path",
  2984. // "required": true,
  2985. // "type": "string"
  2986. // },
  2987. // "userId": {
  2988. // "description": "The ID of the user.",
  2989. // "location": "path",
  2990. // "required": true,
  2991. // "type": "string"
  2992. // }
  2993. // },
  2994. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
  2995. // "response": {
  2996. // "$ref": "Device"
  2997. // },
  2998. // "scopes": [
  2999. // "https://www.googleapis.com/auth/androidenterprise"
  3000. // ]
  3001. // }
  3002. }
  3003. // method id "androidenterprise.devices.getState":
  3004. type DevicesGetStateCall struct {
  3005. s *Service
  3006. enterpriseId string
  3007. userId string
  3008. deviceId string
  3009. urlParams_ gensupport.URLParams
  3010. ifNoneMatch_ string
  3011. ctx_ context.Context
  3012. header_ http.Header
  3013. }
  3014. // GetState: Retrieves whether a device's access to Google services is
  3015. // enabled or disabled. The device state takes effect only if enforcing
  3016. // EMM policies on Android devices is enabled in the Google Admin
  3017. // Console. Otherwise, the device state is ignored and all devices are
  3018. // allowed access to Google services. This is only supported for
  3019. // Google-managed users.
  3020. func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall {
  3021. c := &DevicesGetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3022. c.enterpriseId = enterpriseId
  3023. c.userId = userId
  3024. c.deviceId = deviceId
  3025. return c
  3026. }
  3027. // Fields allows partial responses to be retrieved. See
  3028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3029. // for more information.
  3030. func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall {
  3031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3032. return c
  3033. }
  3034. // IfNoneMatch sets the optional parameter which makes the operation
  3035. // fail if the object's ETag matches the given value. This is useful for
  3036. // getting updates only after the object has changed since the last
  3037. // request. Use googleapi.IsNotModified to check whether the response
  3038. // error from Do is the result of In-None-Match.
  3039. func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall {
  3040. c.ifNoneMatch_ = entityTag
  3041. return c
  3042. }
  3043. // Context sets the context to be used in this call's Do method. Any
  3044. // pending HTTP request will be aborted if the provided context is
  3045. // canceled.
  3046. func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall {
  3047. c.ctx_ = ctx
  3048. return c
  3049. }
  3050. // Header returns an http.Header that can be modified by the caller to
  3051. // add HTTP headers to the request.
  3052. func (c *DevicesGetStateCall) Header() http.Header {
  3053. if c.header_ == nil {
  3054. c.header_ = make(http.Header)
  3055. }
  3056. return c.header_
  3057. }
  3058. func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) {
  3059. reqHeaders := make(http.Header)
  3060. for k, v := range c.header_ {
  3061. reqHeaders[k] = v
  3062. }
  3063. reqHeaders.Set("User-Agent", c.s.userAgent())
  3064. if c.ifNoneMatch_ != "" {
  3065. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3066. }
  3067. var body io.Reader = nil
  3068. c.urlParams_.Set("alt", alt)
  3069. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
  3070. urls += "?" + c.urlParams_.Encode()
  3071. req, _ := http.NewRequest("GET", urls, body)
  3072. req.Header = reqHeaders
  3073. googleapi.Expand(req.URL, map[string]string{
  3074. "enterpriseId": c.enterpriseId,
  3075. "userId": c.userId,
  3076. "deviceId": c.deviceId,
  3077. })
  3078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3079. }
  3080. // Do executes the "androidenterprise.devices.getState" call.
  3081. // Exactly one of *DeviceState or error will be non-nil. Any non-2xx
  3082. // status code is an error. Response headers are in either
  3083. // *DeviceState.ServerResponse.Header or (if a response was returned at
  3084. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3085. // to check whether the returned error was because
  3086. // http.StatusNotModified was returned.
  3087. func (c *DevicesGetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) {
  3088. gensupport.SetOptions(c.urlParams_, opts...)
  3089. res, err := c.doRequest("json")
  3090. if res != nil && res.StatusCode == http.StatusNotModified {
  3091. if res.Body != nil {
  3092. res.Body.Close()
  3093. }
  3094. return nil, &googleapi.Error{
  3095. Code: res.StatusCode,
  3096. Header: res.Header,
  3097. }
  3098. }
  3099. if err != nil {
  3100. return nil, err
  3101. }
  3102. defer googleapi.CloseBody(res)
  3103. if err := googleapi.CheckResponse(res); err != nil {
  3104. return nil, err
  3105. }
  3106. ret := &DeviceState{
  3107. ServerResponse: googleapi.ServerResponse{
  3108. Header: res.Header,
  3109. HTTPStatusCode: res.StatusCode,
  3110. },
  3111. }
  3112. target := &ret
  3113. if err := gensupport.DecodeResponse(target, res); err != nil {
  3114. return nil, err
  3115. }
  3116. return ret, nil
  3117. // {
  3118. // "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.",
  3119. // "httpMethod": "GET",
  3120. // "id": "androidenterprise.devices.getState",
  3121. // "parameterOrder": [
  3122. // "enterpriseId",
  3123. // "userId",
  3124. // "deviceId"
  3125. // ],
  3126. // "parameters": {
  3127. // "deviceId": {
  3128. // "description": "The ID of the device.",
  3129. // "location": "path",
  3130. // "required": true,
  3131. // "type": "string"
  3132. // },
  3133. // "enterpriseId": {
  3134. // "description": "The ID of the enterprise.",
  3135. // "location": "path",
  3136. // "required": true,
  3137. // "type": "string"
  3138. // },
  3139. // "userId": {
  3140. // "description": "The ID of the user.",
  3141. // "location": "path",
  3142. // "required": true,
  3143. // "type": "string"
  3144. // }
  3145. // },
  3146. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
  3147. // "response": {
  3148. // "$ref": "DeviceState"
  3149. // },
  3150. // "scopes": [
  3151. // "https://www.googleapis.com/auth/androidenterprise"
  3152. // ]
  3153. // }
  3154. }
  3155. // method id "androidenterprise.devices.list":
  3156. type DevicesListCall struct {
  3157. s *Service
  3158. enterpriseId string
  3159. userId string
  3160. urlParams_ gensupport.URLParams
  3161. ifNoneMatch_ string
  3162. ctx_ context.Context
  3163. header_ http.Header
  3164. }
  3165. // List: Retrieves the IDs of all of a user's devices.
  3166. func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall {
  3167. c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3168. c.enterpriseId = enterpriseId
  3169. c.userId = userId
  3170. return c
  3171. }
  3172. // Fields allows partial responses to be retrieved. See
  3173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3174. // for more information.
  3175. func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall {
  3176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3177. return c
  3178. }
  3179. // IfNoneMatch sets the optional parameter which makes the operation
  3180. // fail if the object's ETag matches the given value. This is useful for
  3181. // getting updates only after the object has changed since the last
  3182. // request. Use googleapi.IsNotModified to check whether the response
  3183. // error from Do is the result of In-None-Match.
  3184. func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall {
  3185. c.ifNoneMatch_ = entityTag
  3186. return c
  3187. }
  3188. // Context sets the context to be used in this call's Do method. Any
  3189. // pending HTTP request will be aborted if the provided context is
  3190. // canceled.
  3191. func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall {
  3192. c.ctx_ = ctx
  3193. return c
  3194. }
  3195. // Header returns an http.Header that can be modified by the caller to
  3196. // add HTTP headers to the request.
  3197. func (c *DevicesListCall) Header() http.Header {
  3198. if c.header_ == nil {
  3199. c.header_ = make(http.Header)
  3200. }
  3201. return c.header_
  3202. }
  3203. func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) {
  3204. reqHeaders := make(http.Header)
  3205. for k, v := range c.header_ {
  3206. reqHeaders[k] = v
  3207. }
  3208. reqHeaders.Set("User-Agent", c.s.userAgent())
  3209. if c.ifNoneMatch_ != "" {
  3210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3211. }
  3212. var body io.Reader = nil
  3213. c.urlParams_.Set("alt", alt)
  3214. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices")
  3215. urls += "?" + c.urlParams_.Encode()
  3216. req, _ := http.NewRequest("GET", urls, body)
  3217. req.Header = reqHeaders
  3218. googleapi.Expand(req.URL, map[string]string{
  3219. "enterpriseId": c.enterpriseId,
  3220. "userId": c.userId,
  3221. })
  3222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3223. }
  3224. // Do executes the "androidenterprise.devices.list" call.
  3225. // Exactly one of *DevicesListResponse or error will be non-nil. Any
  3226. // non-2xx status code is an error. Response headers are in either
  3227. // *DevicesListResponse.ServerResponse.Header or (if a response was
  3228. // returned at all) in error.(*googleapi.Error).Header. Use
  3229. // googleapi.IsNotModified to check whether the returned error was
  3230. // because http.StatusNotModified was returned.
  3231. func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*DevicesListResponse, error) {
  3232. gensupport.SetOptions(c.urlParams_, opts...)
  3233. res, err := c.doRequest("json")
  3234. if res != nil && res.StatusCode == http.StatusNotModified {
  3235. if res.Body != nil {
  3236. res.Body.Close()
  3237. }
  3238. return nil, &googleapi.Error{
  3239. Code: res.StatusCode,
  3240. Header: res.Header,
  3241. }
  3242. }
  3243. if err != nil {
  3244. return nil, err
  3245. }
  3246. defer googleapi.CloseBody(res)
  3247. if err := googleapi.CheckResponse(res); err != nil {
  3248. return nil, err
  3249. }
  3250. ret := &DevicesListResponse{
  3251. ServerResponse: googleapi.ServerResponse{
  3252. Header: res.Header,
  3253. HTTPStatusCode: res.StatusCode,
  3254. },
  3255. }
  3256. target := &ret
  3257. if err := gensupport.DecodeResponse(target, res); err != nil {
  3258. return nil, err
  3259. }
  3260. return ret, nil
  3261. // {
  3262. // "description": "Retrieves the IDs of all of a user's devices.",
  3263. // "httpMethod": "GET",
  3264. // "id": "androidenterprise.devices.list",
  3265. // "parameterOrder": [
  3266. // "enterpriseId",
  3267. // "userId"
  3268. // ],
  3269. // "parameters": {
  3270. // "enterpriseId": {
  3271. // "description": "The ID of the enterprise.",
  3272. // "location": "path",
  3273. // "required": true,
  3274. // "type": "string"
  3275. // },
  3276. // "userId": {
  3277. // "description": "The ID of the user.",
  3278. // "location": "path",
  3279. // "required": true,
  3280. // "type": "string"
  3281. // }
  3282. // },
  3283. // "path": "enterprises/{enterpriseId}/users/{userId}/devices",
  3284. // "response": {
  3285. // "$ref": "DevicesListResponse"
  3286. // },
  3287. // "scopes": [
  3288. // "https://www.googleapis.com/auth/androidenterprise"
  3289. // ]
  3290. // }
  3291. }
  3292. // method id "androidenterprise.devices.patch":
  3293. type DevicesPatchCall struct {
  3294. s *Service
  3295. enterpriseId string
  3296. userId string
  3297. deviceId string
  3298. device *Device
  3299. urlParams_ gensupport.URLParams
  3300. ctx_ context.Context
  3301. header_ http.Header
  3302. }
  3303. // Patch: Updates the device policy. This method supports patch
  3304. // semantics.
  3305. func (r *DevicesService) Patch(enterpriseId string, userId string, deviceId string, device *Device) *DevicesPatchCall {
  3306. c := &DevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3307. c.enterpriseId = enterpriseId
  3308. c.userId = userId
  3309. c.deviceId = deviceId
  3310. c.device = device
  3311. return c
  3312. }
  3313. // UpdateMask sets the optional parameter "updateMask": Mask that
  3314. // identifies which fields to update. If not set, all modifiable fields
  3315. // will be modified.
  3316. //
  3317. // When set in a query parameter, this field should be specified as
  3318. // updateMask=<field1>,<field2>,...
  3319. func (c *DevicesPatchCall) UpdateMask(updateMask string) *DevicesPatchCall {
  3320. c.urlParams_.Set("updateMask", updateMask)
  3321. return c
  3322. }
  3323. // Fields allows partial responses to be retrieved. See
  3324. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3325. // for more information.
  3326. func (c *DevicesPatchCall) Fields(s ...googleapi.Field) *DevicesPatchCall {
  3327. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3328. return c
  3329. }
  3330. // Context sets the context to be used in this call's Do method. Any
  3331. // pending HTTP request will be aborted if the provided context is
  3332. // canceled.
  3333. func (c *DevicesPatchCall) Context(ctx context.Context) *DevicesPatchCall {
  3334. c.ctx_ = ctx
  3335. return c
  3336. }
  3337. // Header returns an http.Header that can be modified by the caller to
  3338. // add HTTP headers to the request.
  3339. func (c *DevicesPatchCall) Header() http.Header {
  3340. if c.header_ == nil {
  3341. c.header_ = make(http.Header)
  3342. }
  3343. return c.header_
  3344. }
  3345. func (c *DevicesPatchCall) doRequest(alt string) (*http.Response, error) {
  3346. reqHeaders := make(http.Header)
  3347. for k, v := range c.header_ {
  3348. reqHeaders[k] = v
  3349. }
  3350. reqHeaders.Set("User-Agent", c.s.userAgent())
  3351. var body io.Reader = nil
  3352. body, err := googleapi.WithoutDataWrapper.JSONReader(c.device)
  3353. if err != nil {
  3354. return nil, err
  3355. }
  3356. reqHeaders.Set("Content-Type", "application/json")
  3357. c.urlParams_.Set("alt", alt)
  3358. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
  3359. urls += "?" + c.urlParams_.Encode()
  3360. req, _ := http.NewRequest("PATCH", urls, body)
  3361. req.Header = reqHeaders
  3362. googleapi.Expand(req.URL, map[string]string{
  3363. "enterpriseId": c.enterpriseId,
  3364. "userId": c.userId,
  3365. "deviceId": c.deviceId,
  3366. })
  3367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3368. }
  3369. // Do executes the "androidenterprise.devices.patch" call.
  3370. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  3371. // code is an error. Response headers are in either
  3372. // *Device.ServerResponse.Header or (if a response was returned at all)
  3373. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3374. // check whether the returned error was because http.StatusNotModified
  3375. // was returned.
  3376. func (c *DevicesPatchCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  3377. gensupport.SetOptions(c.urlParams_, opts...)
  3378. res, err := c.doRequest("json")
  3379. if res != nil && res.StatusCode == http.StatusNotModified {
  3380. if res.Body != nil {
  3381. res.Body.Close()
  3382. }
  3383. return nil, &googleapi.Error{
  3384. Code: res.StatusCode,
  3385. Header: res.Header,
  3386. }
  3387. }
  3388. if err != nil {
  3389. return nil, err
  3390. }
  3391. defer googleapi.CloseBody(res)
  3392. if err := googleapi.CheckResponse(res); err != nil {
  3393. return nil, err
  3394. }
  3395. ret := &Device{
  3396. ServerResponse: googleapi.ServerResponse{
  3397. Header: res.Header,
  3398. HTTPStatusCode: res.StatusCode,
  3399. },
  3400. }
  3401. target := &ret
  3402. if err := gensupport.DecodeResponse(target, res); err != nil {
  3403. return nil, err
  3404. }
  3405. return ret, nil
  3406. // {
  3407. // "description": "Updates the device policy. This method supports patch semantics.",
  3408. // "httpMethod": "PATCH",
  3409. // "id": "androidenterprise.devices.patch",
  3410. // "parameterOrder": [
  3411. // "enterpriseId",
  3412. // "userId",
  3413. // "deviceId"
  3414. // ],
  3415. // "parameters": {
  3416. // "deviceId": {
  3417. // "description": "The ID of the device.",
  3418. // "location": "path",
  3419. // "required": true,
  3420. // "type": "string"
  3421. // },
  3422. // "enterpriseId": {
  3423. // "description": "The ID of the enterprise.",
  3424. // "location": "path",
  3425. // "required": true,
  3426. // "type": "string"
  3427. // },
  3428. // "updateMask": {
  3429. // "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,...",
  3430. // "location": "query",
  3431. // "type": "string"
  3432. // },
  3433. // "userId": {
  3434. // "description": "The ID of the user.",
  3435. // "location": "path",
  3436. // "required": true,
  3437. // "type": "string"
  3438. // }
  3439. // },
  3440. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
  3441. // "request": {
  3442. // "$ref": "Device"
  3443. // },
  3444. // "response": {
  3445. // "$ref": "Device"
  3446. // },
  3447. // "scopes": [
  3448. // "https://www.googleapis.com/auth/androidenterprise"
  3449. // ]
  3450. // }
  3451. }
  3452. // method id "androidenterprise.devices.setState":
  3453. type DevicesSetStateCall struct {
  3454. s *Service
  3455. enterpriseId string
  3456. userId string
  3457. deviceId string
  3458. devicestate *DeviceState
  3459. urlParams_ gensupport.URLParams
  3460. ctx_ context.Context
  3461. header_ http.Header
  3462. }
  3463. // SetState: Sets whether a device's access to Google services is
  3464. // enabled or disabled. The device state takes effect only if enforcing
  3465. // EMM policies on Android devices is enabled in the Google Admin
  3466. // Console. Otherwise, the device state is ignored and all devices are
  3467. // allowed access to Google services. This is only supported for
  3468. // Google-managed users.
  3469. func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall {
  3470. c := &DevicesSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3471. c.enterpriseId = enterpriseId
  3472. c.userId = userId
  3473. c.deviceId = deviceId
  3474. c.devicestate = devicestate
  3475. return c
  3476. }
  3477. // Fields allows partial responses to be retrieved. See
  3478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3479. // for more information.
  3480. func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall {
  3481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3482. return c
  3483. }
  3484. // Context sets the context to be used in this call's Do method. Any
  3485. // pending HTTP request will be aborted if the provided context is
  3486. // canceled.
  3487. func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall {
  3488. c.ctx_ = ctx
  3489. return c
  3490. }
  3491. // Header returns an http.Header that can be modified by the caller to
  3492. // add HTTP headers to the request.
  3493. func (c *DevicesSetStateCall) Header() http.Header {
  3494. if c.header_ == nil {
  3495. c.header_ = make(http.Header)
  3496. }
  3497. return c.header_
  3498. }
  3499. func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) {
  3500. reqHeaders := make(http.Header)
  3501. for k, v := range c.header_ {
  3502. reqHeaders[k] = v
  3503. }
  3504. reqHeaders.Set("User-Agent", c.s.userAgent())
  3505. var body io.Reader = nil
  3506. body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate)
  3507. if err != nil {
  3508. return nil, err
  3509. }
  3510. reqHeaders.Set("Content-Type", "application/json")
  3511. c.urlParams_.Set("alt", alt)
  3512. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
  3513. urls += "?" + c.urlParams_.Encode()
  3514. req, _ := http.NewRequest("PUT", urls, body)
  3515. req.Header = reqHeaders
  3516. googleapi.Expand(req.URL, map[string]string{
  3517. "enterpriseId": c.enterpriseId,
  3518. "userId": c.userId,
  3519. "deviceId": c.deviceId,
  3520. })
  3521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3522. }
  3523. // Do executes the "androidenterprise.devices.setState" call.
  3524. // Exactly one of *DeviceState or error will be non-nil. Any non-2xx
  3525. // status code is an error. Response headers are in either
  3526. // *DeviceState.ServerResponse.Header or (if a response was returned at
  3527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3528. // to check whether the returned error was because
  3529. // http.StatusNotModified was returned.
  3530. func (c *DevicesSetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) {
  3531. gensupport.SetOptions(c.urlParams_, opts...)
  3532. res, err := c.doRequest("json")
  3533. if res != nil && res.StatusCode == http.StatusNotModified {
  3534. if res.Body != nil {
  3535. res.Body.Close()
  3536. }
  3537. return nil, &googleapi.Error{
  3538. Code: res.StatusCode,
  3539. Header: res.Header,
  3540. }
  3541. }
  3542. if err != nil {
  3543. return nil, err
  3544. }
  3545. defer googleapi.CloseBody(res)
  3546. if err := googleapi.CheckResponse(res); err != nil {
  3547. return nil, err
  3548. }
  3549. ret := &DeviceState{
  3550. ServerResponse: googleapi.ServerResponse{
  3551. Header: res.Header,
  3552. HTTPStatusCode: res.StatusCode,
  3553. },
  3554. }
  3555. target := &ret
  3556. if err := gensupport.DecodeResponse(target, res); err != nil {
  3557. return nil, err
  3558. }
  3559. return ret, nil
  3560. // {
  3561. // "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.",
  3562. // "httpMethod": "PUT",
  3563. // "id": "androidenterprise.devices.setState",
  3564. // "parameterOrder": [
  3565. // "enterpriseId",
  3566. // "userId",
  3567. // "deviceId"
  3568. // ],
  3569. // "parameters": {
  3570. // "deviceId": {
  3571. // "description": "The ID of the device.",
  3572. // "location": "path",
  3573. // "required": true,
  3574. // "type": "string"
  3575. // },
  3576. // "enterpriseId": {
  3577. // "description": "The ID of the enterprise.",
  3578. // "location": "path",
  3579. // "required": true,
  3580. // "type": "string"
  3581. // },
  3582. // "userId": {
  3583. // "description": "The ID of the user.",
  3584. // "location": "path",
  3585. // "required": true,
  3586. // "type": "string"
  3587. // }
  3588. // },
  3589. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
  3590. // "request": {
  3591. // "$ref": "DeviceState"
  3592. // },
  3593. // "response": {
  3594. // "$ref": "DeviceState"
  3595. // },
  3596. // "scopes": [
  3597. // "https://www.googleapis.com/auth/androidenterprise"
  3598. // ]
  3599. // }
  3600. }
  3601. // method id "androidenterprise.devices.update":
  3602. type DevicesUpdateCall struct {
  3603. s *Service
  3604. enterpriseId string
  3605. userId string
  3606. deviceId string
  3607. device *Device
  3608. urlParams_ gensupport.URLParams
  3609. ctx_ context.Context
  3610. header_ http.Header
  3611. }
  3612. // Update: Updates the device policy
  3613. func (r *DevicesService) Update(enterpriseId string, userId string, deviceId string, device *Device) *DevicesUpdateCall {
  3614. c := &DevicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3615. c.enterpriseId = enterpriseId
  3616. c.userId = userId
  3617. c.deviceId = deviceId
  3618. c.device = device
  3619. return c
  3620. }
  3621. // UpdateMask sets the optional parameter "updateMask": Mask that
  3622. // identifies which fields to update. If not set, all modifiable fields
  3623. // will be modified.
  3624. //
  3625. // When set in a query parameter, this field should be specified as
  3626. // updateMask=<field1>,<field2>,...
  3627. func (c *DevicesUpdateCall) UpdateMask(updateMask string) *DevicesUpdateCall {
  3628. c.urlParams_.Set("updateMask", updateMask)
  3629. return c
  3630. }
  3631. // Fields allows partial responses to be retrieved. See
  3632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3633. // for more information.
  3634. func (c *DevicesUpdateCall) Fields(s ...googleapi.Field) *DevicesUpdateCall {
  3635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3636. return c
  3637. }
  3638. // Context sets the context to be used in this call's Do method. Any
  3639. // pending HTTP request will be aborted if the provided context is
  3640. // canceled.
  3641. func (c *DevicesUpdateCall) Context(ctx context.Context) *DevicesUpdateCall {
  3642. c.ctx_ = ctx
  3643. return c
  3644. }
  3645. // Header returns an http.Header that can be modified by the caller to
  3646. // add HTTP headers to the request.
  3647. func (c *DevicesUpdateCall) Header() http.Header {
  3648. if c.header_ == nil {
  3649. c.header_ = make(http.Header)
  3650. }
  3651. return c.header_
  3652. }
  3653. func (c *DevicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3654. reqHeaders := make(http.Header)
  3655. for k, v := range c.header_ {
  3656. reqHeaders[k] = v
  3657. }
  3658. reqHeaders.Set("User-Agent", c.s.userAgent())
  3659. var body io.Reader = nil
  3660. body, err := googleapi.WithoutDataWrapper.JSONReader(c.device)
  3661. if err != nil {
  3662. return nil, err
  3663. }
  3664. reqHeaders.Set("Content-Type", "application/json")
  3665. c.urlParams_.Set("alt", alt)
  3666. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
  3667. urls += "?" + c.urlParams_.Encode()
  3668. req, _ := http.NewRequest("PUT", urls, body)
  3669. req.Header = reqHeaders
  3670. googleapi.Expand(req.URL, map[string]string{
  3671. "enterpriseId": c.enterpriseId,
  3672. "userId": c.userId,
  3673. "deviceId": c.deviceId,
  3674. })
  3675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3676. }
  3677. // Do executes the "androidenterprise.devices.update" call.
  3678. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  3679. // code is an error. Response headers are in either
  3680. // *Device.ServerResponse.Header or (if a response was returned at all)
  3681. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3682. // check whether the returned error was because http.StatusNotModified
  3683. // was returned.
  3684. func (c *DevicesUpdateCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  3685. gensupport.SetOptions(c.urlParams_, opts...)
  3686. res, err := c.doRequest("json")
  3687. if res != nil && res.StatusCode == http.StatusNotModified {
  3688. if res.Body != nil {
  3689. res.Body.Close()
  3690. }
  3691. return nil, &googleapi.Error{
  3692. Code: res.StatusCode,
  3693. Header: res.Header,
  3694. }
  3695. }
  3696. if err != nil {
  3697. return nil, err
  3698. }
  3699. defer googleapi.CloseBody(res)
  3700. if err := googleapi.CheckResponse(res); err != nil {
  3701. return nil, err
  3702. }
  3703. ret := &Device{
  3704. ServerResponse: googleapi.ServerResponse{
  3705. Header: res.Header,
  3706. HTTPStatusCode: res.StatusCode,
  3707. },
  3708. }
  3709. target := &ret
  3710. if err := gensupport.DecodeResponse(target, res); err != nil {
  3711. return nil, err
  3712. }
  3713. return ret, nil
  3714. // {
  3715. // "description": "Updates the device policy",
  3716. // "httpMethod": "PUT",
  3717. // "id": "androidenterprise.devices.update",
  3718. // "parameterOrder": [
  3719. // "enterpriseId",
  3720. // "userId",
  3721. // "deviceId"
  3722. // ],
  3723. // "parameters": {
  3724. // "deviceId": {
  3725. // "description": "The ID of the device.",
  3726. // "location": "path",
  3727. // "required": true,
  3728. // "type": "string"
  3729. // },
  3730. // "enterpriseId": {
  3731. // "description": "The ID of the enterprise.",
  3732. // "location": "path",
  3733. // "required": true,
  3734. // "type": "string"
  3735. // },
  3736. // "updateMask": {
  3737. // "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,...",
  3738. // "location": "query",
  3739. // "type": "string"
  3740. // },
  3741. // "userId": {
  3742. // "description": "The ID of the user.",
  3743. // "location": "path",
  3744. // "required": true,
  3745. // "type": "string"
  3746. // }
  3747. // },
  3748. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
  3749. // "request": {
  3750. // "$ref": "Device"
  3751. // },
  3752. // "response": {
  3753. // "$ref": "Device"
  3754. // },
  3755. // "scopes": [
  3756. // "https://www.googleapis.com/auth/androidenterprise"
  3757. // ]
  3758. // }
  3759. }
  3760. // method id "androidenterprise.enterprises.acknowledgeNotificationSet":
  3761. type EnterprisesAcknowledgeNotificationSetCall struct {
  3762. s *Service
  3763. urlParams_ gensupport.URLParams
  3764. ctx_ context.Context
  3765. header_ http.Header
  3766. }
  3767. // AcknowledgeNotificationSet: Acknowledges notifications that were
  3768. // received from Enterprises.PullNotificationSet to prevent subsequent
  3769. // calls from returning the same notifications.
  3770. func (r *EnterprisesService) AcknowledgeNotificationSet() *EnterprisesAcknowledgeNotificationSetCall {
  3771. c := &EnterprisesAcknowledgeNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3772. return c
  3773. }
  3774. // NotificationSetId sets the optional parameter "notificationSetId":
  3775. // The notification set ID as returned by
  3776. // Enterprises.PullNotificationSet. This must be provided.
  3777. func (c *EnterprisesAcknowledgeNotificationSetCall) NotificationSetId(notificationSetId string) *EnterprisesAcknowledgeNotificationSetCall {
  3778. c.urlParams_.Set("notificationSetId", notificationSetId)
  3779. return c
  3780. }
  3781. // Fields allows partial responses to be retrieved. See
  3782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3783. // for more information.
  3784. func (c *EnterprisesAcknowledgeNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesAcknowledgeNotificationSetCall {
  3785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3786. return c
  3787. }
  3788. // Context sets the context to be used in this call's Do method. Any
  3789. // pending HTTP request will be aborted if the provided context is
  3790. // canceled.
  3791. func (c *EnterprisesAcknowledgeNotificationSetCall) Context(ctx context.Context) *EnterprisesAcknowledgeNotificationSetCall {
  3792. c.ctx_ = ctx
  3793. return c
  3794. }
  3795. // Header returns an http.Header that can be modified by the caller to
  3796. // add HTTP headers to the request.
  3797. func (c *EnterprisesAcknowledgeNotificationSetCall) Header() http.Header {
  3798. if c.header_ == nil {
  3799. c.header_ = make(http.Header)
  3800. }
  3801. return c.header_
  3802. }
  3803. func (c *EnterprisesAcknowledgeNotificationSetCall) doRequest(alt string) (*http.Response, error) {
  3804. reqHeaders := make(http.Header)
  3805. for k, v := range c.header_ {
  3806. reqHeaders[k] = v
  3807. }
  3808. reqHeaders.Set("User-Agent", c.s.userAgent())
  3809. var body io.Reader = nil
  3810. c.urlParams_.Set("alt", alt)
  3811. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/acknowledgeNotificationSet")
  3812. urls += "?" + c.urlParams_.Encode()
  3813. req, _ := http.NewRequest("POST", urls, body)
  3814. req.Header = reqHeaders
  3815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3816. }
  3817. // Do executes the "androidenterprise.enterprises.acknowledgeNotificationSet" call.
  3818. func (c *EnterprisesAcknowledgeNotificationSetCall) Do(opts ...googleapi.CallOption) error {
  3819. gensupport.SetOptions(c.urlParams_, opts...)
  3820. res, err := c.doRequest("json")
  3821. if err != nil {
  3822. return err
  3823. }
  3824. defer googleapi.CloseBody(res)
  3825. if err := googleapi.CheckResponse(res); err != nil {
  3826. return err
  3827. }
  3828. return nil
  3829. // {
  3830. // "description": "Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.",
  3831. // "httpMethod": "POST",
  3832. // "id": "androidenterprise.enterprises.acknowledgeNotificationSet",
  3833. // "parameters": {
  3834. // "notificationSetId": {
  3835. // "description": "The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided.",
  3836. // "location": "query",
  3837. // "type": "string"
  3838. // }
  3839. // },
  3840. // "path": "enterprises/acknowledgeNotificationSet",
  3841. // "scopes": [
  3842. // "https://www.googleapis.com/auth/androidenterprise"
  3843. // ]
  3844. // }
  3845. }
  3846. // method id "androidenterprise.enterprises.completeSignup":
  3847. type EnterprisesCompleteSignupCall struct {
  3848. s *Service
  3849. urlParams_ gensupport.URLParams
  3850. ctx_ context.Context
  3851. header_ http.Header
  3852. }
  3853. // CompleteSignup: Completes the signup flow, by specifying the
  3854. // Completion token and Enterprise token. This request must not be
  3855. // called multiple times for a given Enterprise Token.
  3856. func (r *EnterprisesService) CompleteSignup() *EnterprisesCompleteSignupCall {
  3857. c := &EnterprisesCompleteSignupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3858. return c
  3859. }
  3860. // CompletionToken sets the optional parameter "completionToken": The
  3861. // Completion token initially returned by GenerateSignupUrl.
  3862. func (c *EnterprisesCompleteSignupCall) CompletionToken(completionToken string) *EnterprisesCompleteSignupCall {
  3863. c.urlParams_.Set("completionToken", completionToken)
  3864. return c
  3865. }
  3866. // EnterpriseToken sets the optional parameter "enterpriseToken": The
  3867. // Enterprise token appended to the Callback URL.
  3868. func (c *EnterprisesCompleteSignupCall) EnterpriseToken(enterpriseToken string) *EnterprisesCompleteSignupCall {
  3869. c.urlParams_.Set("enterpriseToken", enterpriseToken)
  3870. return c
  3871. }
  3872. // Fields allows partial responses to be retrieved. See
  3873. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3874. // for more information.
  3875. func (c *EnterprisesCompleteSignupCall) Fields(s ...googleapi.Field) *EnterprisesCompleteSignupCall {
  3876. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3877. return c
  3878. }
  3879. // Context sets the context to be used in this call's Do method. Any
  3880. // pending HTTP request will be aborted if the provided context is
  3881. // canceled.
  3882. func (c *EnterprisesCompleteSignupCall) Context(ctx context.Context) *EnterprisesCompleteSignupCall {
  3883. c.ctx_ = ctx
  3884. return c
  3885. }
  3886. // Header returns an http.Header that can be modified by the caller to
  3887. // add HTTP headers to the request.
  3888. func (c *EnterprisesCompleteSignupCall) Header() http.Header {
  3889. if c.header_ == nil {
  3890. c.header_ = make(http.Header)
  3891. }
  3892. return c.header_
  3893. }
  3894. func (c *EnterprisesCompleteSignupCall) doRequest(alt string) (*http.Response, error) {
  3895. reqHeaders := make(http.Header)
  3896. for k, v := range c.header_ {
  3897. reqHeaders[k] = v
  3898. }
  3899. reqHeaders.Set("User-Agent", c.s.userAgent())
  3900. var body io.Reader = nil
  3901. c.urlParams_.Set("alt", alt)
  3902. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/completeSignup")
  3903. urls += "?" + c.urlParams_.Encode()
  3904. req, _ := http.NewRequest("POST", urls, body)
  3905. req.Header = reqHeaders
  3906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3907. }
  3908. // Do executes the "androidenterprise.enterprises.completeSignup" call.
  3909. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  3910. // status code is an error. Response headers are in either
  3911. // *Enterprise.ServerResponse.Header or (if a response was returned at
  3912. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3913. // to check whether the returned error was because
  3914. // http.StatusNotModified was returned.
  3915. func (c *EnterprisesCompleteSignupCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  3916. gensupport.SetOptions(c.urlParams_, opts...)
  3917. res, err := c.doRequest("json")
  3918. if res != nil && res.StatusCode == http.StatusNotModified {
  3919. if res.Body != nil {
  3920. res.Body.Close()
  3921. }
  3922. return nil, &googleapi.Error{
  3923. Code: res.StatusCode,
  3924. Header: res.Header,
  3925. }
  3926. }
  3927. if err != nil {
  3928. return nil, err
  3929. }
  3930. defer googleapi.CloseBody(res)
  3931. if err := googleapi.CheckResponse(res); err != nil {
  3932. return nil, err
  3933. }
  3934. ret := &Enterprise{
  3935. ServerResponse: googleapi.ServerResponse{
  3936. Header: res.Header,
  3937. HTTPStatusCode: res.StatusCode,
  3938. },
  3939. }
  3940. target := &ret
  3941. if err := gensupport.DecodeResponse(target, res); err != nil {
  3942. return nil, err
  3943. }
  3944. return ret, nil
  3945. // {
  3946. // "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.",
  3947. // "httpMethod": "POST",
  3948. // "id": "androidenterprise.enterprises.completeSignup",
  3949. // "parameters": {
  3950. // "completionToken": {
  3951. // "description": "The Completion token initially returned by GenerateSignupUrl.",
  3952. // "location": "query",
  3953. // "type": "string"
  3954. // },
  3955. // "enterpriseToken": {
  3956. // "description": "The Enterprise token appended to the Callback URL.",
  3957. // "location": "query",
  3958. // "type": "string"
  3959. // }
  3960. // },
  3961. // "path": "enterprises/completeSignup",
  3962. // "response": {
  3963. // "$ref": "Enterprise"
  3964. // },
  3965. // "scopes": [
  3966. // "https://www.googleapis.com/auth/androidenterprise"
  3967. // ]
  3968. // }
  3969. }
  3970. // method id "androidenterprise.enterprises.createWebToken":
  3971. type EnterprisesCreateWebTokenCall struct {
  3972. s *Service
  3973. enterpriseId string
  3974. administratorwebtokenspec *AdministratorWebTokenSpec
  3975. urlParams_ gensupport.URLParams
  3976. ctx_ context.Context
  3977. header_ http.Header
  3978. }
  3979. // CreateWebToken: Returns a unique token to access an embeddable UI. To
  3980. // generate a web UI, pass the generated token into the managed Google
  3981. // Play javascript API. Each token may only be used to start one UI
  3982. // session. See the javascript API documentation for further
  3983. // information.
  3984. func (r *EnterprisesService) CreateWebToken(enterpriseId string, administratorwebtokenspec *AdministratorWebTokenSpec) *EnterprisesCreateWebTokenCall {
  3985. c := &EnterprisesCreateWebTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3986. c.enterpriseId = enterpriseId
  3987. c.administratorwebtokenspec = administratorwebtokenspec
  3988. return c
  3989. }
  3990. // Fields allows partial responses to be retrieved. See
  3991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3992. // for more information.
  3993. func (c *EnterprisesCreateWebTokenCall) Fields(s ...googleapi.Field) *EnterprisesCreateWebTokenCall {
  3994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3995. return c
  3996. }
  3997. // Context sets the context to be used in this call's Do method. Any
  3998. // pending HTTP request will be aborted if the provided context is
  3999. // canceled.
  4000. func (c *EnterprisesCreateWebTokenCall) Context(ctx context.Context) *EnterprisesCreateWebTokenCall {
  4001. c.ctx_ = ctx
  4002. return c
  4003. }
  4004. // Header returns an http.Header that can be modified by the caller to
  4005. // add HTTP headers to the request.
  4006. func (c *EnterprisesCreateWebTokenCall) Header() http.Header {
  4007. if c.header_ == nil {
  4008. c.header_ = make(http.Header)
  4009. }
  4010. return c.header_
  4011. }
  4012. func (c *EnterprisesCreateWebTokenCall) doRequest(alt string) (*http.Response, error) {
  4013. reqHeaders := make(http.Header)
  4014. for k, v := range c.header_ {
  4015. reqHeaders[k] = v
  4016. }
  4017. reqHeaders.Set("User-Agent", c.s.userAgent())
  4018. var body io.Reader = nil
  4019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.administratorwebtokenspec)
  4020. if err != nil {
  4021. return nil, err
  4022. }
  4023. reqHeaders.Set("Content-Type", "application/json")
  4024. c.urlParams_.Set("alt", alt)
  4025. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/createWebToken")
  4026. urls += "?" + c.urlParams_.Encode()
  4027. req, _ := http.NewRequest("POST", urls, body)
  4028. req.Header = reqHeaders
  4029. googleapi.Expand(req.URL, map[string]string{
  4030. "enterpriseId": c.enterpriseId,
  4031. })
  4032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4033. }
  4034. // Do executes the "androidenterprise.enterprises.createWebToken" call.
  4035. // Exactly one of *AdministratorWebToken or error will be non-nil. Any
  4036. // non-2xx status code is an error. Response headers are in either
  4037. // *AdministratorWebToken.ServerResponse.Header or (if a response was
  4038. // returned at all) in error.(*googleapi.Error).Header. Use
  4039. // googleapi.IsNotModified to check whether the returned error was
  4040. // because http.StatusNotModified was returned.
  4041. func (c *EnterprisesCreateWebTokenCall) Do(opts ...googleapi.CallOption) (*AdministratorWebToken, error) {
  4042. gensupport.SetOptions(c.urlParams_, opts...)
  4043. res, err := c.doRequest("json")
  4044. if res != nil && res.StatusCode == http.StatusNotModified {
  4045. if res.Body != nil {
  4046. res.Body.Close()
  4047. }
  4048. return nil, &googleapi.Error{
  4049. Code: res.StatusCode,
  4050. Header: res.Header,
  4051. }
  4052. }
  4053. if err != nil {
  4054. return nil, err
  4055. }
  4056. defer googleapi.CloseBody(res)
  4057. if err := googleapi.CheckResponse(res); err != nil {
  4058. return nil, err
  4059. }
  4060. ret := &AdministratorWebToken{
  4061. ServerResponse: googleapi.ServerResponse{
  4062. Header: res.Header,
  4063. HTTPStatusCode: res.StatusCode,
  4064. },
  4065. }
  4066. target := &ret
  4067. if err := gensupport.DecodeResponse(target, res); err != nil {
  4068. return nil, err
  4069. }
  4070. return ret, nil
  4071. // {
  4072. // "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.",
  4073. // "httpMethod": "POST",
  4074. // "id": "androidenterprise.enterprises.createWebToken",
  4075. // "parameterOrder": [
  4076. // "enterpriseId"
  4077. // ],
  4078. // "parameters": {
  4079. // "enterpriseId": {
  4080. // "description": "The ID of the enterprise.",
  4081. // "location": "path",
  4082. // "required": true,
  4083. // "type": "string"
  4084. // }
  4085. // },
  4086. // "path": "enterprises/{enterpriseId}/createWebToken",
  4087. // "request": {
  4088. // "$ref": "AdministratorWebTokenSpec"
  4089. // },
  4090. // "response": {
  4091. // "$ref": "AdministratorWebToken"
  4092. // },
  4093. // "scopes": [
  4094. // "https://www.googleapis.com/auth/androidenterprise"
  4095. // ]
  4096. // }
  4097. }
  4098. // method id "androidenterprise.enterprises.delete":
  4099. type EnterprisesDeleteCall struct {
  4100. s *Service
  4101. enterpriseId string
  4102. urlParams_ gensupport.URLParams
  4103. ctx_ context.Context
  4104. header_ http.Header
  4105. }
  4106. // Delete: Deletes the binding between the EMM and enterprise. This is
  4107. // now deprecated. Use this method only to unenroll customers that were
  4108. // previously enrolled with the insert call, then enroll them again with
  4109. // the enroll call.
  4110. func (r *EnterprisesService) Delete(enterpriseId string) *EnterprisesDeleteCall {
  4111. c := &EnterprisesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4112. c.enterpriseId = enterpriseId
  4113. return c
  4114. }
  4115. // Fields allows partial responses to be retrieved. See
  4116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4117. // for more information.
  4118. func (c *EnterprisesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDeleteCall {
  4119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4120. return c
  4121. }
  4122. // Context sets the context to be used in this call's Do method. Any
  4123. // pending HTTP request will be aborted if the provided context is
  4124. // canceled.
  4125. func (c *EnterprisesDeleteCall) Context(ctx context.Context) *EnterprisesDeleteCall {
  4126. c.ctx_ = ctx
  4127. return c
  4128. }
  4129. // Header returns an http.Header that can be modified by the caller to
  4130. // add HTTP headers to the request.
  4131. func (c *EnterprisesDeleteCall) Header() http.Header {
  4132. if c.header_ == nil {
  4133. c.header_ = make(http.Header)
  4134. }
  4135. return c.header_
  4136. }
  4137. func (c *EnterprisesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4138. reqHeaders := make(http.Header)
  4139. for k, v := range c.header_ {
  4140. reqHeaders[k] = v
  4141. }
  4142. reqHeaders.Set("User-Agent", c.s.userAgent())
  4143. var body io.Reader = nil
  4144. c.urlParams_.Set("alt", alt)
  4145. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
  4146. urls += "?" + c.urlParams_.Encode()
  4147. req, _ := http.NewRequest("DELETE", urls, body)
  4148. req.Header = reqHeaders
  4149. googleapi.Expand(req.URL, map[string]string{
  4150. "enterpriseId": c.enterpriseId,
  4151. })
  4152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4153. }
  4154. // Do executes the "androidenterprise.enterprises.delete" call.
  4155. func (c *EnterprisesDeleteCall) Do(opts ...googleapi.CallOption) error {
  4156. gensupport.SetOptions(c.urlParams_, opts...)
  4157. res, err := c.doRequest("json")
  4158. if err != nil {
  4159. return err
  4160. }
  4161. defer googleapi.CloseBody(res)
  4162. if err := googleapi.CheckResponse(res); err != nil {
  4163. return err
  4164. }
  4165. return nil
  4166. // {
  4167. // "description": "Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled with the insert call, then enroll them again with the enroll call.",
  4168. // "httpMethod": "DELETE",
  4169. // "id": "androidenterprise.enterprises.delete",
  4170. // "parameterOrder": [
  4171. // "enterpriseId"
  4172. // ],
  4173. // "parameters": {
  4174. // "enterpriseId": {
  4175. // "description": "The ID of the enterprise.",
  4176. // "location": "path",
  4177. // "required": true,
  4178. // "type": "string"
  4179. // }
  4180. // },
  4181. // "path": "enterprises/{enterpriseId}",
  4182. // "scopes": [
  4183. // "https://www.googleapis.com/auth/androidenterprise"
  4184. // ]
  4185. // }
  4186. }
  4187. // method id "androidenterprise.enterprises.enroll":
  4188. type EnterprisesEnrollCall struct {
  4189. s *Service
  4190. enterprise *Enterprise
  4191. urlParams_ gensupport.URLParams
  4192. ctx_ context.Context
  4193. header_ http.Header
  4194. }
  4195. // Enroll: Enrolls an enterprise with the calling EMM.
  4196. func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall {
  4197. c := &EnterprisesEnrollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4198. c.urlParams_.Set("token", token)
  4199. c.enterprise = enterprise
  4200. return c
  4201. }
  4202. // Fields allows partial responses to be retrieved. See
  4203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4204. // for more information.
  4205. func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall {
  4206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4207. return c
  4208. }
  4209. // Context sets the context to be used in this call's Do method. Any
  4210. // pending HTTP request will be aborted if the provided context is
  4211. // canceled.
  4212. func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall {
  4213. c.ctx_ = ctx
  4214. return c
  4215. }
  4216. // Header returns an http.Header that can be modified by the caller to
  4217. // add HTTP headers to the request.
  4218. func (c *EnterprisesEnrollCall) Header() http.Header {
  4219. if c.header_ == nil {
  4220. c.header_ = make(http.Header)
  4221. }
  4222. return c.header_
  4223. }
  4224. func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) {
  4225. reqHeaders := make(http.Header)
  4226. for k, v := range c.header_ {
  4227. reqHeaders[k] = v
  4228. }
  4229. reqHeaders.Set("User-Agent", c.s.userAgent())
  4230. var body io.Reader = nil
  4231. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
  4232. if err != nil {
  4233. return nil, err
  4234. }
  4235. reqHeaders.Set("Content-Type", "application/json")
  4236. c.urlParams_.Set("alt", alt)
  4237. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/enroll")
  4238. urls += "?" + c.urlParams_.Encode()
  4239. req, _ := http.NewRequest("POST", urls, body)
  4240. req.Header = reqHeaders
  4241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4242. }
  4243. // Do executes the "androidenterprise.enterprises.enroll" call.
  4244. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  4245. // status code is an error. Response headers are in either
  4246. // *Enterprise.ServerResponse.Header or (if a response was returned at
  4247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4248. // to check whether the returned error was because
  4249. // http.StatusNotModified was returned.
  4250. func (c *EnterprisesEnrollCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  4251. gensupport.SetOptions(c.urlParams_, opts...)
  4252. res, err := c.doRequest("json")
  4253. if res != nil && res.StatusCode == http.StatusNotModified {
  4254. if res.Body != nil {
  4255. res.Body.Close()
  4256. }
  4257. return nil, &googleapi.Error{
  4258. Code: res.StatusCode,
  4259. Header: res.Header,
  4260. }
  4261. }
  4262. if err != nil {
  4263. return nil, err
  4264. }
  4265. defer googleapi.CloseBody(res)
  4266. if err := googleapi.CheckResponse(res); err != nil {
  4267. return nil, err
  4268. }
  4269. ret := &Enterprise{
  4270. ServerResponse: googleapi.ServerResponse{
  4271. Header: res.Header,
  4272. HTTPStatusCode: res.StatusCode,
  4273. },
  4274. }
  4275. target := &ret
  4276. if err := gensupport.DecodeResponse(target, res); err != nil {
  4277. return nil, err
  4278. }
  4279. return ret, nil
  4280. // {
  4281. // "description": "Enrolls an enterprise with the calling EMM.",
  4282. // "httpMethod": "POST",
  4283. // "id": "androidenterprise.enterprises.enroll",
  4284. // "parameterOrder": [
  4285. // "token"
  4286. // ],
  4287. // "parameters": {
  4288. // "token": {
  4289. // "description": "The token provided by the enterprise to register the EMM.",
  4290. // "location": "query",
  4291. // "required": true,
  4292. // "type": "string"
  4293. // }
  4294. // },
  4295. // "path": "enterprises/enroll",
  4296. // "request": {
  4297. // "$ref": "Enterprise"
  4298. // },
  4299. // "response": {
  4300. // "$ref": "Enterprise"
  4301. // },
  4302. // "scopes": [
  4303. // "https://www.googleapis.com/auth/androidenterprise"
  4304. // ]
  4305. // }
  4306. }
  4307. // method id "androidenterprise.enterprises.generateSignupUrl":
  4308. type EnterprisesGenerateSignupUrlCall struct {
  4309. s *Service
  4310. urlParams_ gensupport.URLParams
  4311. ctx_ context.Context
  4312. header_ http.Header
  4313. }
  4314. // GenerateSignupUrl: Generates a sign-up URL.
  4315. func (r *EnterprisesService) GenerateSignupUrl() *EnterprisesGenerateSignupUrlCall {
  4316. c := &EnterprisesGenerateSignupUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4317. return c
  4318. }
  4319. // CallbackUrl sets the optional parameter "callbackUrl": The callback
  4320. // URL to which the Admin will be redirected after successfully creating
  4321. // an enterprise. Before redirecting there the system will add a single
  4322. // query parameter to this URL named "enterpriseToken" which will
  4323. // contain an opaque token to be used for the CompleteSignup
  4324. // request.
  4325. // Beware that this means that the URL will be parsed, the parameter
  4326. // added and then a new URL formatted, i.e. there may be some minor
  4327. // formatting changes and, more importantly, the URL must be well-formed
  4328. // so that it can be parsed.
  4329. func (c *EnterprisesGenerateSignupUrlCall) CallbackUrl(callbackUrl string) *EnterprisesGenerateSignupUrlCall {
  4330. c.urlParams_.Set("callbackUrl", callbackUrl)
  4331. return c
  4332. }
  4333. // Fields allows partial responses to be retrieved. See
  4334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4335. // for more information.
  4336. func (c *EnterprisesGenerateSignupUrlCall) Fields(s ...googleapi.Field) *EnterprisesGenerateSignupUrlCall {
  4337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4338. return c
  4339. }
  4340. // Context sets the context to be used in this call's Do method. Any
  4341. // pending HTTP request will be aborted if the provided context is
  4342. // canceled.
  4343. func (c *EnterprisesGenerateSignupUrlCall) Context(ctx context.Context) *EnterprisesGenerateSignupUrlCall {
  4344. c.ctx_ = ctx
  4345. return c
  4346. }
  4347. // Header returns an http.Header that can be modified by the caller to
  4348. // add HTTP headers to the request.
  4349. func (c *EnterprisesGenerateSignupUrlCall) Header() http.Header {
  4350. if c.header_ == nil {
  4351. c.header_ = make(http.Header)
  4352. }
  4353. return c.header_
  4354. }
  4355. func (c *EnterprisesGenerateSignupUrlCall) doRequest(alt string) (*http.Response, error) {
  4356. reqHeaders := make(http.Header)
  4357. for k, v := range c.header_ {
  4358. reqHeaders[k] = v
  4359. }
  4360. reqHeaders.Set("User-Agent", c.s.userAgent())
  4361. var body io.Reader = nil
  4362. c.urlParams_.Set("alt", alt)
  4363. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/signupUrl")
  4364. urls += "?" + c.urlParams_.Encode()
  4365. req, _ := http.NewRequest("POST", urls, body)
  4366. req.Header = reqHeaders
  4367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4368. }
  4369. // Do executes the "androidenterprise.enterprises.generateSignupUrl" call.
  4370. // Exactly one of *SignupInfo or error will be non-nil. Any non-2xx
  4371. // status code is an error. Response headers are in either
  4372. // *SignupInfo.ServerResponse.Header or (if a response was returned at
  4373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4374. // to check whether the returned error was because
  4375. // http.StatusNotModified was returned.
  4376. func (c *EnterprisesGenerateSignupUrlCall) Do(opts ...googleapi.CallOption) (*SignupInfo, error) {
  4377. gensupport.SetOptions(c.urlParams_, opts...)
  4378. res, err := c.doRequest("json")
  4379. if res != nil && res.StatusCode == http.StatusNotModified {
  4380. if res.Body != nil {
  4381. res.Body.Close()
  4382. }
  4383. return nil, &googleapi.Error{
  4384. Code: res.StatusCode,
  4385. Header: res.Header,
  4386. }
  4387. }
  4388. if err != nil {
  4389. return nil, err
  4390. }
  4391. defer googleapi.CloseBody(res)
  4392. if err := googleapi.CheckResponse(res); err != nil {
  4393. return nil, err
  4394. }
  4395. ret := &SignupInfo{
  4396. ServerResponse: googleapi.ServerResponse{
  4397. Header: res.Header,
  4398. HTTPStatusCode: res.StatusCode,
  4399. },
  4400. }
  4401. target := &ret
  4402. if err := gensupport.DecodeResponse(target, res); err != nil {
  4403. return nil, err
  4404. }
  4405. return ret, nil
  4406. // {
  4407. // "description": "Generates a sign-up URL.",
  4408. // "httpMethod": "POST",
  4409. // "id": "androidenterprise.enterprises.generateSignupUrl",
  4410. // "parameters": {
  4411. // "callbackUrl": {
  4412. // "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.",
  4413. // "location": "query",
  4414. // "type": "string"
  4415. // }
  4416. // },
  4417. // "path": "enterprises/signupUrl",
  4418. // "response": {
  4419. // "$ref": "SignupInfo"
  4420. // },
  4421. // "scopes": [
  4422. // "https://www.googleapis.com/auth/androidenterprise"
  4423. // ]
  4424. // }
  4425. }
  4426. // method id "androidenterprise.enterprises.get":
  4427. type EnterprisesGetCall struct {
  4428. s *Service
  4429. enterpriseId string
  4430. urlParams_ gensupport.URLParams
  4431. ifNoneMatch_ string
  4432. ctx_ context.Context
  4433. header_ http.Header
  4434. }
  4435. // Get: Retrieves the name and domain of an enterprise.
  4436. func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall {
  4437. c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4438. c.enterpriseId = enterpriseId
  4439. return c
  4440. }
  4441. // Fields allows partial responses to be retrieved. See
  4442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4443. // for more information.
  4444. func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall {
  4445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4446. return c
  4447. }
  4448. // IfNoneMatch sets the optional parameter which makes the operation
  4449. // fail if the object's ETag matches the given value. This is useful for
  4450. // getting updates only after the object has changed since the last
  4451. // request. Use googleapi.IsNotModified to check whether the response
  4452. // error from Do is the result of In-None-Match.
  4453. func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall {
  4454. c.ifNoneMatch_ = entityTag
  4455. return c
  4456. }
  4457. // Context sets the context to be used in this call's Do method. Any
  4458. // pending HTTP request will be aborted if the provided context is
  4459. // canceled.
  4460. func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall {
  4461. c.ctx_ = ctx
  4462. return c
  4463. }
  4464. // Header returns an http.Header that can be modified by the caller to
  4465. // add HTTP headers to the request.
  4466. func (c *EnterprisesGetCall) Header() http.Header {
  4467. if c.header_ == nil {
  4468. c.header_ = make(http.Header)
  4469. }
  4470. return c.header_
  4471. }
  4472. func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) {
  4473. reqHeaders := make(http.Header)
  4474. for k, v := range c.header_ {
  4475. reqHeaders[k] = v
  4476. }
  4477. reqHeaders.Set("User-Agent", c.s.userAgent())
  4478. if c.ifNoneMatch_ != "" {
  4479. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4480. }
  4481. var body io.Reader = nil
  4482. c.urlParams_.Set("alt", alt)
  4483. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
  4484. urls += "?" + c.urlParams_.Encode()
  4485. req, _ := http.NewRequest("GET", urls, body)
  4486. req.Header = reqHeaders
  4487. googleapi.Expand(req.URL, map[string]string{
  4488. "enterpriseId": c.enterpriseId,
  4489. })
  4490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4491. }
  4492. // Do executes the "androidenterprise.enterprises.get" call.
  4493. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  4494. // status code is an error. Response headers are in either
  4495. // *Enterprise.ServerResponse.Header or (if a response was returned at
  4496. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4497. // to check whether the returned error was because
  4498. // http.StatusNotModified was returned.
  4499. func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  4500. gensupport.SetOptions(c.urlParams_, opts...)
  4501. res, err := c.doRequest("json")
  4502. if res != nil && res.StatusCode == http.StatusNotModified {
  4503. if res.Body != nil {
  4504. res.Body.Close()
  4505. }
  4506. return nil, &googleapi.Error{
  4507. Code: res.StatusCode,
  4508. Header: res.Header,
  4509. }
  4510. }
  4511. if err != nil {
  4512. return nil, err
  4513. }
  4514. defer googleapi.CloseBody(res)
  4515. if err := googleapi.CheckResponse(res); err != nil {
  4516. return nil, err
  4517. }
  4518. ret := &Enterprise{
  4519. ServerResponse: googleapi.ServerResponse{
  4520. Header: res.Header,
  4521. HTTPStatusCode: res.StatusCode,
  4522. },
  4523. }
  4524. target := &ret
  4525. if err := gensupport.DecodeResponse(target, res); err != nil {
  4526. return nil, err
  4527. }
  4528. return ret, nil
  4529. // {
  4530. // "description": "Retrieves the name and domain of an enterprise.",
  4531. // "httpMethod": "GET",
  4532. // "id": "androidenterprise.enterprises.get",
  4533. // "parameterOrder": [
  4534. // "enterpriseId"
  4535. // ],
  4536. // "parameters": {
  4537. // "enterpriseId": {
  4538. // "description": "The ID of the enterprise.",
  4539. // "location": "path",
  4540. // "required": true,
  4541. // "type": "string"
  4542. // }
  4543. // },
  4544. // "path": "enterprises/{enterpriseId}",
  4545. // "response": {
  4546. // "$ref": "Enterprise"
  4547. // },
  4548. // "scopes": [
  4549. // "https://www.googleapis.com/auth/androidenterprise"
  4550. // ]
  4551. // }
  4552. }
  4553. // method id "androidenterprise.enterprises.getAndroidDevicePolicyConfig":
  4554. type EnterprisesGetAndroidDevicePolicyConfigCall struct {
  4555. s *Service
  4556. enterpriseId string
  4557. urlParams_ gensupport.URLParams
  4558. ifNoneMatch_ string
  4559. ctx_ context.Context
  4560. header_ http.Header
  4561. }
  4562. // GetAndroidDevicePolicyConfig: Deprecated and unused.
  4563. func (r *EnterprisesService) GetAndroidDevicePolicyConfig(enterpriseId string) *EnterprisesGetAndroidDevicePolicyConfigCall {
  4564. c := &EnterprisesGetAndroidDevicePolicyConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4565. c.enterpriseId = enterpriseId
  4566. return c
  4567. }
  4568. // Fields allows partial responses to be retrieved. See
  4569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4570. // for more information.
  4571. func (c *EnterprisesGetAndroidDevicePolicyConfigCall) Fields(s ...googleapi.Field) *EnterprisesGetAndroidDevicePolicyConfigCall {
  4572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4573. return c
  4574. }
  4575. // IfNoneMatch sets the optional parameter which makes the operation
  4576. // fail if the object's ETag matches the given value. This is useful for
  4577. // getting updates only after the object has changed since the last
  4578. // request. Use googleapi.IsNotModified to check whether the response
  4579. // error from Do is the result of In-None-Match.
  4580. func (c *EnterprisesGetAndroidDevicePolicyConfigCall) IfNoneMatch(entityTag string) *EnterprisesGetAndroidDevicePolicyConfigCall {
  4581. c.ifNoneMatch_ = entityTag
  4582. return c
  4583. }
  4584. // Context sets the context to be used in this call's Do method. Any
  4585. // pending HTTP request will be aborted if the provided context is
  4586. // canceled.
  4587. func (c *EnterprisesGetAndroidDevicePolicyConfigCall) Context(ctx context.Context) *EnterprisesGetAndroidDevicePolicyConfigCall {
  4588. c.ctx_ = ctx
  4589. return c
  4590. }
  4591. // Header returns an http.Header that can be modified by the caller to
  4592. // add HTTP headers to the request.
  4593. func (c *EnterprisesGetAndroidDevicePolicyConfigCall) Header() http.Header {
  4594. if c.header_ == nil {
  4595. c.header_ = make(http.Header)
  4596. }
  4597. return c.header_
  4598. }
  4599. func (c *EnterprisesGetAndroidDevicePolicyConfigCall) doRequest(alt string) (*http.Response, error) {
  4600. reqHeaders := make(http.Header)
  4601. for k, v := range c.header_ {
  4602. reqHeaders[k] = v
  4603. }
  4604. reqHeaders.Set("User-Agent", c.s.userAgent())
  4605. if c.ifNoneMatch_ != "" {
  4606. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4607. }
  4608. var body io.Reader = nil
  4609. c.urlParams_.Set("alt", alt)
  4610. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/androidDevicePolicyConfig")
  4611. urls += "?" + c.urlParams_.Encode()
  4612. req, _ := http.NewRequest("GET", urls, body)
  4613. req.Header = reqHeaders
  4614. googleapi.Expand(req.URL, map[string]string{
  4615. "enterpriseId": c.enterpriseId,
  4616. })
  4617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4618. }
  4619. // Do executes the "androidenterprise.enterprises.getAndroidDevicePolicyConfig" call.
  4620. // Exactly one of *AndroidDevicePolicyConfig or error will be non-nil.
  4621. // Any non-2xx status code is an error. Response headers are in either
  4622. // *AndroidDevicePolicyConfig.ServerResponse.Header or (if a response
  4623. // was returned at all) in error.(*googleapi.Error).Header. Use
  4624. // googleapi.IsNotModified to check whether the returned error was
  4625. // because http.StatusNotModified was returned.
  4626. func (c *EnterprisesGetAndroidDevicePolicyConfigCall) Do(opts ...googleapi.CallOption) (*AndroidDevicePolicyConfig, error) {
  4627. gensupport.SetOptions(c.urlParams_, opts...)
  4628. res, err := c.doRequest("json")
  4629. if res != nil && res.StatusCode == http.StatusNotModified {
  4630. if res.Body != nil {
  4631. res.Body.Close()
  4632. }
  4633. return nil, &googleapi.Error{
  4634. Code: res.StatusCode,
  4635. Header: res.Header,
  4636. }
  4637. }
  4638. if err != nil {
  4639. return nil, err
  4640. }
  4641. defer googleapi.CloseBody(res)
  4642. if err := googleapi.CheckResponse(res); err != nil {
  4643. return nil, err
  4644. }
  4645. ret := &AndroidDevicePolicyConfig{
  4646. ServerResponse: googleapi.ServerResponse{
  4647. Header: res.Header,
  4648. HTTPStatusCode: res.StatusCode,
  4649. },
  4650. }
  4651. target := &ret
  4652. if err := gensupport.DecodeResponse(target, res); err != nil {
  4653. return nil, err
  4654. }
  4655. return ret, nil
  4656. // {
  4657. // "description": "Deprecated and unused.",
  4658. // "httpMethod": "GET",
  4659. // "id": "androidenterprise.enterprises.getAndroidDevicePolicyConfig",
  4660. // "parameterOrder": [
  4661. // "enterpriseId"
  4662. // ],
  4663. // "parameters": {
  4664. // "enterpriseId": {
  4665. // "description": "The ID of the enterprise.",
  4666. // "location": "path",
  4667. // "required": true,
  4668. // "type": "string"
  4669. // }
  4670. // },
  4671. // "path": "enterprises/{enterpriseId}/androidDevicePolicyConfig",
  4672. // "response": {
  4673. // "$ref": "AndroidDevicePolicyConfig"
  4674. // },
  4675. // "scopes": [
  4676. // "https://www.googleapis.com/auth/androidenterprise"
  4677. // ]
  4678. // }
  4679. }
  4680. // method id "androidenterprise.enterprises.getServiceAccount":
  4681. type EnterprisesGetServiceAccountCall struct {
  4682. s *Service
  4683. enterpriseId string
  4684. urlParams_ gensupport.URLParams
  4685. ifNoneMatch_ string
  4686. ctx_ context.Context
  4687. header_ http.Header
  4688. }
  4689. // GetServiceAccount: Returns a service account and credentials. The
  4690. // service account can be bound to the enterprise by calling setAccount.
  4691. // The service account is unique to this enterprise and EMM, and will be
  4692. // deleted if the enterprise is unbound. The credentials contain private
  4693. // key data and are not stored server-side.
  4694. //
  4695. // This method can only be called after calling Enterprises.Enroll or
  4696. // Enterprises.CompleteSignup, and before Enterprises.SetAccount; at
  4697. // other times it will return an error.
  4698. //
  4699. // Subsequent calls after the first will generate a new, unique set of
  4700. // credentials, and invalidate the previously generated
  4701. // credentials.
  4702. //
  4703. // Once the service account is bound to the enterprise, it can be
  4704. // managed using the serviceAccountKeys resource.
  4705. func (r *EnterprisesService) GetServiceAccount(enterpriseId string) *EnterprisesGetServiceAccountCall {
  4706. c := &EnterprisesGetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4707. c.enterpriseId = enterpriseId
  4708. return c
  4709. }
  4710. // KeyType sets the optional parameter "keyType": The type of credential
  4711. // to return with the service account. Required.
  4712. //
  4713. // Possible values:
  4714. // "googleCredentials"
  4715. // "pkcs12"
  4716. func (c *EnterprisesGetServiceAccountCall) KeyType(keyType string) *EnterprisesGetServiceAccountCall {
  4717. c.urlParams_.Set("keyType", keyType)
  4718. return c
  4719. }
  4720. // Fields allows partial responses to be retrieved. See
  4721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4722. // for more information.
  4723. func (c *EnterprisesGetServiceAccountCall) Fields(s ...googleapi.Field) *EnterprisesGetServiceAccountCall {
  4724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4725. return c
  4726. }
  4727. // IfNoneMatch sets the optional parameter which makes the operation
  4728. // fail if the object's ETag matches the given value. This is useful for
  4729. // getting updates only after the object has changed since the last
  4730. // request. Use googleapi.IsNotModified to check whether the response
  4731. // error from Do is the result of In-None-Match.
  4732. func (c *EnterprisesGetServiceAccountCall) IfNoneMatch(entityTag string) *EnterprisesGetServiceAccountCall {
  4733. c.ifNoneMatch_ = entityTag
  4734. return c
  4735. }
  4736. // Context sets the context to be used in this call's Do method. Any
  4737. // pending HTTP request will be aborted if the provided context is
  4738. // canceled.
  4739. func (c *EnterprisesGetServiceAccountCall) Context(ctx context.Context) *EnterprisesGetServiceAccountCall {
  4740. c.ctx_ = ctx
  4741. return c
  4742. }
  4743. // Header returns an http.Header that can be modified by the caller to
  4744. // add HTTP headers to the request.
  4745. func (c *EnterprisesGetServiceAccountCall) Header() http.Header {
  4746. if c.header_ == nil {
  4747. c.header_ = make(http.Header)
  4748. }
  4749. return c.header_
  4750. }
  4751. func (c *EnterprisesGetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  4752. reqHeaders := make(http.Header)
  4753. for k, v := range c.header_ {
  4754. reqHeaders[k] = v
  4755. }
  4756. reqHeaders.Set("User-Agent", c.s.userAgent())
  4757. if c.ifNoneMatch_ != "" {
  4758. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4759. }
  4760. var body io.Reader = nil
  4761. c.urlParams_.Set("alt", alt)
  4762. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccount")
  4763. urls += "?" + c.urlParams_.Encode()
  4764. req, _ := http.NewRequest("GET", urls, body)
  4765. req.Header = reqHeaders
  4766. googleapi.Expand(req.URL, map[string]string{
  4767. "enterpriseId": c.enterpriseId,
  4768. })
  4769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4770. }
  4771. // Do executes the "androidenterprise.enterprises.getServiceAccount" call.
  4772. // Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
  4773. // status code is an error. Response headers are in either
  4774. // *ServiceAccount.ServerResponse.Header or (if a response was returned
  4775. // at all) in error.(*googleapi.Error).Header. Use
  4776. // googleapi.IsNotModified to check whether the returned error was
  4777. // because http.StatusNotModified was returned.
  4778. func (c *EnterprisesGetServiceAccountCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
  4779. gensupport.SetOptions(c.urlParams_, opts...)
  4780. res, err := c.doRequest("json")
  4781. if res != nil && res.StatusCode == http.StatusNotModified {
  4782. if res.Body != nil {
  4783. res.Body.Close()
  4784. }
  4785. return nil, &googleapi.Error{
  4786. Code: res.StatusCode,
  4787. Header: res.Header,
  4788. }
  4789. }
  4790. if err != nil {
  4791. return nil, err
  4792. }
  4793. defer googleapi.CloseBody(res)
  4794. if err := googleapi.CheckResponse(res); err != nil {
  4795. return nil, err
  4796. }
  4797. ret := &ServiceAccount{
  4798. ServerResponse: googleapi.ServerResponse{
  4799. Header: res.Header,
  4800. HTTPStatusCode: res.StatusCode,
  4801. },
  4802. }
  4803. target := &ret
  4804. if err := gensupport.DecodeResponse(target, res); err != nil {
  4805. return nil, err
  4806. }
  4807. return ret, nil
  4808. // {
  4809. // "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.",
  4810. // "httpMethod": "GET",
  4811. // "id": "androidenterprise.enterprises.getServiceAccount",
  4812. // "parameterOrder": [
  4813. // "enterpriseId"
  4814. // ],
  4815. // "parameters": {
  4816. // "enterpriseId": {
  4817. // "description": "The ID of the enterprise.",
  4818. // "location": "path",
  4819. // "required": true,
  4820. // "type": "string"
  4821. // },
  4822. // "keyType": {
  4823. // "description": "The type of credential to return with the service account. Required.",
  4824. // "enum": [
  4825. // "googleCredentials",
  4826. // "pkcs12"
  4827. // ],
  4828. // "enumDescriptions": [
  4829. // "",
  4830. // ""
  4831. // ],
  4832. // "location": "query",
  4833. // "type": "string"
  4834. // }
  4835. // },
  4836. // "path": "enterprises/{enterpriseId}/serviceAccount",
  4837. // "response": {
  4838. // "$ref": "ServiceAccount"
  4839. // },
  4840. // "scopes": [
  4841. // "https://www.googleapis.com/auth/androidenterprise"
  4842. // ]
  4843. // }
  4844. }
  4845. // method id "androidenterprise.enterprises.getStoreLayout":
  4846. type EnterprisesGetStoreLayoutCall struct {
  4847. s *Service
  4848. enterpriseId string
  4849. urlParams_ gensupport.URLParams
  4850. ifNoneMatch_ string
  4851. ctx_ context.Context
  4852. header_ http.Header
  4853. }
  4854. // GetStoreLayout: Returns the store layout for the enterprise. If the
  4855. // store layout has not been set, returns "basic" as the store layout
  4856. // type and no homepage.
  4857. func (r *EnterprisesService) GetStoreLayout(enterpriseId string) *EnterprisesGetStoreLayoutCall {
  4858. c := &EnterprisesGetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4859. c.enterpriseId = enterpriseId
  4860. return c
  4861. }
  4862. // Fields allows partial responses to be retrieved. See
  4863. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4864. // for more information.
  4865. func (c *EnterprisesGetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesGetStoreLayoutCall {
  4866. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4867. return c
  4868. }
  4869. // IfNoneMatch sets the optional parameter which makes the operation
  4870. // fail if the object's ETag matches the given value. This is useful for
  4871. // getting updates only after the object has changed since the last
  4872. // request. Use googleapi.IsNotModified to check whether the response
  4873. // error from Do is the result of In-None-Match.
  4874. func (c *EnterprisesGetStoreLayoutCall) IfNoneMatch(entityTag string) *EnterprisesGetStoreLayoutCall {
  4875. c.ifNoneMatch_ = entityTag
  4876. return c
  4877. }
  4878. // Context sets the context to be used in this call's Do method. Any
  4879. // pending HTTP request will be aborted if the provided context is
  4880. // canceled.
  4881. func (c *EnterprisesGetStoreLayoutCall) Context(ctx context.Context) *EnterprisesGetStoreLayoutCall {
  4882. c.ctx_ = ctx
  4883. return c
  4884. }
  4885. // Header returns an http.Header that can be modified by the caller to
  4886. // add HTTP headers to the request.
  4887. func (c *EnterprisesGetStoreLayoutCall) Header() http.Header {
  4888. if c.header_ == nil {
  4889. c.header_ = make(http.Header)
  4890. }
  4891. return c.header_
  4892. }
  4893. func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, error) {
  4894. reqHeaders := make(http.Header)
  4895. for k, v := range c.header_ {
  4896. reqHeaders[k] = v
  4897. }
  4898. reqHeaders.Set("User-Agent", c.s.userAgent())
  4899. if c.ifNoneMatch_ != "" {
  4900. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4901. }
  4902. var body io.Reader = nil
  4903. c.urlParams_.Set("alt", alt)
  4904. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout")
  4905. urls += "?" + c.urlParams_.Encode()
  4906. req, _ := http.NewRequest("GET", urls, body)
  4907. req.Header = reqHeaders
  4908. googleapi.Expand(req.URL, map[string]string{
  4909. "enterpriseId": c.enterpriseId,
  4910. })
  4911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4912. }
  4913. // Do executes the "androidenterprise.enterprises.getStoreLayout" call.
  4914. // Exactly one of *StoreLayout or error will be non-nil. Any non-2xx
  4915. // status code is an error. Response headers are in either
  4916. // *StoreLayout.ServerResponse.Header or (if a response was returned at
  4917. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4918. // to check whether the returned error was because
  4919. // http.StatusNotModified was returned.
  4920. func (c *EnterprisesGetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) {
  4921. gensupport.SetOptions(c.urlParams_, opts...)
  4922. res, err := c.doRequest("json")
  4923. if res != nil && res.StatusCode == http.StatusNotModified {
  4924. if res.Body != nil {
  4925. res.Body.Close()
  4926. }
  4927. return nil, &googleapi.Error{
  4928. Code: res.StatusCode,
  4929. Header: res.Header,
  4930. }
  4931. }
  4932. if err != nil {
  4933. return nil, err
  4934. }
  4935. defer googleapi.CloseBody(res)
  4936. if err := googleapi.CheckResponse(res); err != nil {
  4937. return nil, err
  4938. }
  4939. ret := &StoreLayout{
  4940. ServerResponse: googleapi.ServerResponse{
  4941. Header: res.Header,
  4942. HTTPStatusCode: res.StatusCode,
  4943. },
  4944. }
  4945. target := &ret
  4946. if err := gensupport.DecodeResponse(target, res); err != nil {
  4947. return nil, err
  4948. }
  4949. return ret, nil
  4950. // {
  4951. // "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.",
  4952. // "httpMethod": "GET",
  4953. // "id": "androidenterprise.enterprises.getStoreLayout",
  4954. // "parameterOrder": [
  4955. // "enterpriseId"
  4956. // ],
  4957. // "parameters": {
  4958. // "enterpriseId": {
  4959. // "description": "The ID of the enterprise.",
  4960. // "location": "path",
  4961. // "required": true,
  4962. // "type": "string"
  4963. // }
  4964. // },
  4965. // "path": "enterprises/{enterpriseId}/storeLayout",
  4966. // "response": {
  4967. // "$ref": "StoreLayout"
  4968. // },
  4969. // "scopes": [
  4970. // "https://www.googleapis.com/auth/androidenterprise"
  4971. // ]
  4972. // }
  4973. }
  4974. // method id "androidenterprise.enterprises.insert":
  4975. type EnterprisesInsertCall struct {
  4976. s *Service
  4977. enterprise *Enterprise
  4978. urlParams_ gensupport.URLParams
  4979. ctx_ context.Context
  4980. header_ http.Header
  4981. }
  4982. // Insert: Establishes the binding between the EMM and an enterprise.
  4983. // This is now deprecated; use enroll instead.
  4984. func (r *EnterprisesService) Insert(token string, enterprise *Enterprise) *EnterprisesInsertCall {
  4985. c := &EnterprisesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4986. c.urlParams_.Set("token", token)
  4987. c.enterprise = enterprise
  4988. return c
  4989. }
  4990. // Fields allows partial responses to be retrieved. See
  4991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4992. // for more information.
  4993. func (c *EnterprisesInsertCall) Fields(s ...googleapi.Field) *EnterprisesInsertCall {
  4994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4995. return c
  4996. }
  4997. // Context sets the context to be used in this call's Do method. Any
  4998. // pending HTTP request will be aborted if the provided context is
  4999. // canceled.
  5000. func (c *EnterprisesInsertCall) Context(ctx context.Context) *EnterprisesInsertCall {
  5001. c.ctx_ = ctx
  5002. return c
  5003. }
  5004. // Header returns an http.Header that can be modified by the caller to
  5005. // add HTTP headers to the request.
  5006. func (c *EnterprisesInsertCall) Header() http.Header {
  5007. if c.header_ == nil {
  5008. c.header_ = make(http.Header)
  5009. }
  5010. return c.header_
  5011. }
  5012. func (c *EnterprisesInsertCall) doRequest(alt string) (*http.Response, error) {
  5013. reqHeaders := make(http.Header)
  5014. for k, v := range c.header_ {
  5015. reqHeaders[k] = v
  5016. }
  5017. reqHeaders.Set("User-Agent", c.s.userAgent())
  5018. var body io.Reader = nil
  5019. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
  5020. if err != nil {
  5021. return nil, err
  5022. }
  5023. reqHeaders.Set("Content-Type", "application/json")
  5024. c.urlParams_.Set("alt", alt)
  5025. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
  5026. urls += "?" + c.urlParams_.Encode()
  5027. req, _ := http.NewRequest("POST", urls, body)
  5028. req.Header = reqHeaders
  5029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5030. }
  5031. // Do executes the "androidenterprise.enterprises.insert" call.
  5032. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  5033. // status code is an error. Response headers are in either
  5034. // *Enterprise.ServerResponse.Header or (if a response was returned at
  5035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5036. // to check whether the returned error was because
  5037. // http.StatusNotModified was returned.
  5038. func (c *EnterprisesInsertCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  5039. gensupport.SetOptions(c.urlParams_, opts...)
  5040. res, err := c.doRequest("json")
  5041. if res != nil && res.StatusCode == http.StatusNotModified {
  5042. if res.Body != nil {
  5043. res.Body.Close()
  5044. }
  5045. return nil, &googleapi.Error{
  5046. Code: res.StatusCode,
  5047. Header: res.Header,
  5048. }
  5049. }
  5050. if err != nil {
  5051. return nil, err
  5052. }
  5053. defer googleapi.CloseBody(res)
  5054. if err := googleapi.CheckResponse(res); err != nil {
  5055. return nil, err
  5056. }
  5057. ret := &Enterprise{
  5058. ServerResponse: googleapi.ServerResponse{
  5059. Header: res.Header,
  5060. HTTPStatusCode: res.StatusCode,
  5061. },
  5062. }
  5063. target := &ret
  5064. if err := gensupport.DecodeResponse(target, res); err != nil {
  5065. return nil, err
  5066. }
  5067. return ret, nil
  5068. // {
  5069. // "description": "Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead.",
  5070. // "httpMethod": "POST",
  5071. // "id": "androidenterprise.enterprises.insert",
  5072. // "parameterOrder": [
  5073. // "token"
  5074. // ],
  5075. // "parameters": {
  5076. // "token": {
  5077. // "description": "The token provided by the enterprise to register the EMM.",
  5078. // "location": "query",
  5079. // "required": true,
  5080. // "type": "string"
  5081. // }
  5082. // },
  5083. // "path": "enterprises",
  5084. // "request": {
  5085. // "$ref": "Enterprise"
  5086. // },
  5087. // "response": {
  5088. // "$ref": "Enterprise"
  5089. // },
  5090. // "scopes": [
  5091. // "https://www.googleapis.com/auth/androidenterprise"
  5092. // ]
  5093. // }
  5094. }
  5095. // method id "androidenterprise.enterprises.list":
  5096. type EnterprisesListCall struct {
  5097. s *Service
  5098. urlParams_ gensupport.URLParams
  5099. ifNoneMatch_ string
  5100. ctx_ context.Context
  5101. header_ http.Header
  5102. }
  5103. // List: Looks up an enterprise by domain name. This is only supported
  5104. // for enterprises created via the Google-initiated creation flow.
  5105. // Lookup of the id is not needed for enterprises created via the
  5106. // EMM-initiated flow since the EMM learns the enterprise ID in the
  5107. // callback specified in the Enterprises.generateSignupUrl call.
  5108. func (r *EnterprisesService) List(domain string) *EnterprisesListCall {
  5109. c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5110. c.urlParams_.Set("domain", domain)
  5111. return c
  5112. }
  5113. // Fields allows partial responses to be retrieved. See
  5114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5115. // for more information.
  5116. func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall {
  5117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5118. return c
  5119. }
  5120. // IfNoneMatch sets the optional parameter which makes the operation
  5121. // fail if the object's ETag matches the given value. This is useful for
  5122. // getting updates only after the object has changed since the last
  5123. // request. Use googleapi.IsNotModified to check whether the response
  5124. // error from Do is the result of In-None-Match.
  5125. func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall {
  5126. c.ifNoneMatch_ = entityTag
  5127. return c
  5128. }
  5129. // Context sets the context to be used in this call's Do method. Any
  5130. // pending HTTP request will be aborted if the provided context is
  5131. // canceled.
  5132. func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall {
  5133. c.ctx_ = ctx
  5134. return c
  5135. }
  5136. // Header returns an http.Header that can be modified by the caller to
  5137. // add HTTP headers to the request.
  5138. func (c *EnterprisesListCall) Header() http.Header {
  5139. if c.header_ == nil {
  5140. c.header_ = make(http.Header)
  5141. }
  5142. return c.header_
  5143. }
  5144. func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) {
  5145. reqHeaders := make(http.Header)
  5146. for k, v := range c.header_ {
  5147. reqHeaders[k] = v
  5148. }
  5149. reqHeaders.Set("User-Agent", c.s.userAgent())
  5150. if c.ifNoneMatch_ != "" {
  5151. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5152. }
  5153. var body io.Reader = nil
  5154. c.urlParams_.Set("alt", alt)
  5155. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
  5156. urls += "?" + c.urlParams_.Encode()
  5157. req, _ := http.NewRequest("GET", urls, body)
  5158. req.Header = reqHeaders
  5159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5160. }
  5161. // Do executes the "androidenterprise.enterprises.list" call.
  5162. // Exactly one of *EnterprisesListResponse or error will be non-nil. Any
  5163. // non-2xx status code is an error. Response headers are in either
  5164. // *EnterprisesListResponse.ServerResponse.Header or (if a response was
  5165. // returned at all) in error.(*googleapi.Error).Header. Use
  5166. // googleapi.IsNotModified to check whether the returned error was
  5167. // because http.StatusNotModified was returned.
  5168. func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*EnterprisesListResponse, error) {
  5169. gensupport.SetOptions(c.urlParams_, opts...)
  5170. res, err := c.doRequest("json")
  5171. if res != nil && res.StatusCode == http.StatusNotModified {
  5172. if res.Body != nil {
  5173. res.Body.Close()
  5174. }
  5175. return nil, &googleapi.Error{
  5176. Code: res.StatusCode,
  5177. Header: res.Header,
  5178. }
  5179. }
  5180. if err != nil {
  5181. return nil, err
  5182. }
  5183. defer googleapi.CloseBody(res)
  5184. if err := googleapi.CheckResponse(res); err != nil {
  5185. return nil, err
  5186. }
  5187. ret := &EnterprisesListResponse{
  5188. ServerResponse: googleapi.ServerResponse{
  5189. Header: res.Header,
  5190. HTTPStatusCode: res.StatusCode,
  5191. },
  5192. }
  5193. target := &ret
  5194. if err := gensupport.DecodeResponse(target, res); err != nil {
  5195. return nil, err
  5196. }
  5197. return ret, nil
  5198. // {
  5199. // "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.",
  5200. // "httpMethod": "GET",
  5201. // "id": "androidenterprise.enterprises.list",
  5202. // "parameterOrder": [
  5203. // "domain"
  5204. // ],
  5205. // "parameters": {
  5206. // "domain": {
  5207. // "description": "The exact primary domain name of the enterprise to look up.",
  5208. // "location": "query",
  5209. // "required": true,
  5210. // "type": "string"
  5211. // }
  5212. // },
  5213. // "path": "enterprises",
  5214. // "response": {
  5215. // "$ref": "EnterprisesListResponse"
  5216. // },
  5217. // "scopes": [
  5218. // "https://www.googleapis.com/auth/androidenterprise"
  5219. // ]
  5220. // }
  5221. }
  5222. // method id "androidenterprise.enterprises.pullNotificationSet":
  5223. type EnterprisesPullNotificationSetCall struct {
  5224. s *Service
  5225. urlParams_ gensupport.URLParams
  5226. ctx_ context.Context
  5227. header_ http.Header
  5228. }
  5229. // PullNotificationSet: Pulls and returns a notification set for the
  5230. // enterprises associated with the service account authenticated for the
  5231. // request. The notification set may be empty if no notification are
  5232. // pending.
  5233. // A notification set returned needs to be acknowledged within 20
  5234. // seconds by calling Enterprises.AcknowledgeNotificationSet, unless the
  5235. // notification set is empty.
  5236. // Notifications that are not acknowledged within the 20 seconds will
  5237. // eventually be included again in the response to another
  5238. // PullNotificationSet request, and those that are never acknowledged
  5239. // will ultimately be deleted according to the Google Cloud Platform
  5240. // Pub/Sub system policy.
  5241. // Multiple requests might be performed concurrently to retrieve
  5242. // notifications, in which case the pending notifications (if any) will
  5243. // be split among each caller, if any are pending.
  5244. // If no notifications are present, an empty notification list is
  5245. // returned. Subsequent requests may return more notifications once they
  5246. // become available.
  5247. func (r *EnterprisesService) PullNotificationSet() *EnterprisesPullNotificationSetCall {
  5248. c := &EnterprisesPullNotificationSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5249. return c
  5250. }
  5251. // RequestMode sets the optional parameter "requestMode": The request
  5252. // mode for pulling notifications.
  5253. // Specifying waitForNotifications will cause the request to block and
  5254. // wait until one or more notifications are present, or return an empty
  5255. // notification list if no notifications are present after some
  5256. // time.
  5257. // Speciying returnImmediately will cause the request to immediately
  5258. // return the pending notifications, or an empty list if no
  5259. // notifications are present.
  5260. // If omitted, defaults to waitForNotifications.
  5261. //
  5262. // Possible values:
  5263. // "returnImmediately"
  5264. // "waitForNotifications"
  5265. func (c *EnterprisesPullNotificationSetCall) RequestMode(requestMode string) *EnterprisesPullNotificationSetCall {
  5266. c.urlParams_.Set("requestMode", requestMode)
  5267. return c
  5268. }
  5269. // Fields allows partial responses to be retrieved. See
  5270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5271. // for more information.
  5272. func (c *EnterprisesPullNotificationSetCall) Fields(s ...googleapi.Field) *EnterprisesPullNotificationSetCall {
  5273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5274. return c
  5275. }
  5276. // Context sets the context to be used in this call's Do method. Any
  5277. // pending HTTP request will be aborted if the provided context is
  5278. // canceled.
  5279. func (c *EnterprisesPullNotificationSetCall) Context(ctx context.Context) *EnterprisesPullNotificationSetCall {
  5280. c.ctx_ = ctx
  5281. return c
  5282. }
  5283. // Header returns an http.Header that can be modified by the caller to
  5284. // add HTTP headers to the request.
  5285. func (c *EnterprisesPullNotificationSetCall) Header() http.Header {
  5286. if c.header_ == nil {
  5287. c.header_ = make(http.Header)
  5288. }
  5289. return c.header_
  5290. }
  5291. func (c *EnterprisesPullNotificationSetCall) doRequest(alt string) (*http.Response, error) {
  5292. reqHeaders := make(http.Header)
  5293. for k, v := range c.header_ {
  5294. reqHeaders[k] = v
  5295. }
  5296. reqHeaders.Set("User-Agent", c.s.userAgent())
  5297. var body io.Reader = nil
  5298. c.urlParams_.Set("alt", alt)
  5299. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/pullNotificationSet")
  5300. urls += "?" + c.urlParams_.Encode()
  5301. req, _ := http.NewRequest("POST", urls, body)
  5302. req.Header = reqHeaders
  5303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5304. }
  5305. // Do executes the "androidenterprise.enterprises.pullNotificationSet" call.
  5306. // Exactly one of *NotificationSet or error will be non-nil. Any non-2xx
  5307. // status code is an error. Response headers are in either
  5308. // *NotificationSet.ServerResponse.Header or (if a response was returned
  5309. // at all) in error.(*googleapi.Error).Header. Use
  5310. // googleapi.IsNotModified to check whether the returned error was
  5311. // because http.StatusNotModified was returned.
  5312. func (c *EnterprisesPullNotificationSetCall) Do(opts ...googleapi.CallOption) (*NotificationSet, error) {
  5313. gensupport.SetOptions(c.urlParams_, opts...)
  5314. res, err := c.doRequest("json")
  5315. if res != nil && res.StatusCode == http.StatusNotModified {
  5316. if res.Body != nil {
  5317. res.Body.Close()
  5318. }
  5319. return nil, &googleapi.Error{
  5320. Code: res.StatusCode,
  5321. Header: res.Header,
  5322. }
  5323. }
  5324. if err != nil {
  5325. return nil, err
  5326. }
  5327. defer googleapi.CloseBody(res)
  5328. if err := googleapi.CheckResponse(res); err != nil {
  5329. return nil, err
  5330. }
  5331. ret := &NotificationSet{
  5332. ServerResponse: googleapi.ServerResponse{
  5333. Header: res.Header,
  5334. HTTPStatusCode: res.StatusCode,
  5335. },
  5336. }
  5337. target := &ret
  5338. if err := gensupport.DecodeResponse(target, res); err != nil {
  5339. return nil, err
  5340. }
  5341. return ret, nil
  5342. // {
  5343. // "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.",
  5344. // "httpMethod": "POST",
  5345. // "id": "androidenterprise.enterprises.pullNotificationSet",
  5346. // "parameters": {
  5347. // "requestMode": {
  5348. // "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.",
  5349. // "enum": [
  5350. // "returnImmediately",
  5351. // "waitForNotifications"
  5352. // ],
  5353. // "enumDescriptions": [
  5354. // "",
  5355. // ""
  5356. // ],
  5357. // "location": "query",
  5358. // "type": "string"
  5359. // }
  5360. // },
  5361. // "path": "enterprises/pullNotificationSet",
  5362. // "response": {
  5363. // "$ref": "NotificationSet"
  5364. // },
  5365. // "scopes": [
  5366. // "https://www.googleapis.com/auth/androidenterprise"
  5367. // ]
  5368. // }
  5369. }
  5370. // method id "androidenterprise.enterprises.sendTestPushNotification":
  5371. type EnterprisesSendTestPushNotificationCall struct {
  5372. s *Service
  5373. enterpriseId string
  5374. urlParams_ gensupport.URLParams
  5375. ctx_ context.Context
  5376. header_ http.Header
  5377. }
  5378. // SendTestPushNotification: Sends a test notification to validate the
  5379. // EMM integration with the Google Cloud Pub/Sub service for this
  5380. // enterprise.
  5381. func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall {
  5382. c := &EnterprisesSendTestPushNotificationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5383. c.enterpriseId = enterpriseId
  5384. return c
  5385. }
  5386. // Fields allows partial responses to be retrieved. See
  5387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5388. // for more information.
  5389. func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall {
  5390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5391. return c
  5392. }
  5393. // Context sets the context to be used in this call's Do method. Any
  5394. // pending HTTP request will be aborted if the provided context is
  5395. // canceled.
  5396. func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall {
  5397. c.ctx_ = ctx
  5398. return c
  5399. }
  5400. // Header returns an http.Header that can be modified by the caller to
  5401. // add HTTP headers to the request.
  5402. func (c *EnterprisesSendTestPushNotificationCall) Header() http.Header {
  5403. if c.header_ == nil {
  5404. c.header_ = make(http.Header)
  5405. }
  5406. return c.header_
  5407. }
  5408. func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) {
  5409. reqHeaders := make(http.Header)
  5410. for k, v := range c.header_ {
  5411. reqHeaders[k] = v
  5412. }
  5413. reqHeaders.Set("User-Agent", c.s.userAgent())
  5414. var body io.Reader = nil
  5415. c.urlParams_.Set("alt", alt)
  5416. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/sendTestPushNotification")
  5417. urls += "?" + c.urlParams_.Encode()
  5418. req, _ := http.NewRequest("POST", urls, body)
  5419. req.Header = reqHeaders
  5420. googleapi.Expand(req.URL, map[string]string{
  5421. "enterpriseId": c.enterpriseId,
  5422. })
  5423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5424. }
  5425. // Do executes the "androidenterprise.enterprises.sendTestPushNotification" call.
  5426. // Exactly one of *EnterprisesSendTestPushNotificationResponse or error
  5427. // will be non-nil. Any non-2xx status code is an error. Response
  5428. // headers are in either
  5429. // *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or
  5430. // (if a response was returned at all) in
  5431. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5432. // whether the returned error was because http.StatusNotModified was
  5433. // returned.
  5434. func (c *EnterprisesSendTestPushNotificationCall) Do(opts ...googleapi.CallOption) (*EnterprisesSendTestPushNotificationResponse, error) {
  5435. gensupport.SetOptions(c.urlParams_, opts...)
  5436. res, err := c.doRequest("json")
  5437. if res != nil && res.StatusCode == http.StatusNotModified {
  5438. if res.Body != nil {
  5439. res.Body.Close()
  5440. }
  5441. return nil, &googleapi.Error{
  5442. Code: res.StatusCode,
  5443. Header: res.Header,
  5444. }
  5445. }
  5446. if err != nil {
  5447. return nil, err
  5448. }
  5449. defer googleapi.CloseBody(res)
  5450. if err := googleapi.CheckResponse(res); err != nil {
  5451. return nil, err
  5452. }
  5453. ret := &EnterprisesSendTestPushNotificationResponse{
  5454. ServerResponse: googleapi.ServerResponse{
  5455. Header: res.Header,
  5456. HTTPStatusCode: res.StatusCode,
  5457. },
  5458. }
  5459. target := &ret
  5460. if err := gensupport.DecodeResponse(target, res); err != nil {
  5461. return nil, err
  5462. }
  5463. return ret, nil
  5464. // {
  5465. // "description": "Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.",
  5466. // "httpMethod": "POST",
  5467. // "id": "androidenterprise.enterprises.sendTestPushNotification",
  5468. // "parameterOrder": [
  5469. // "enterpriseId"
  5470. // ],
  5471. // "parameters": {
  5472. // "enterpriseId": {
  5473. // "description": "The ID of the enterprise.",
  5474. // "location": "path",
  5475. // "required": true,
  5476. // "type": "string"
  5477. // }
  5478. // },
  5479. // "path": "enterprises/{enterpriseId}/sendTestPushNotification",
  5480. // "response": {
  5481. // "$ref": "EnterprisesSendTestPushNotificationResponse"
  5482. // },
  5483. // "scopes": [
  5484. // "https://www.googleapis.com/auth/androidenterprise"
  5485. // ]
  5486. // }
  5487. }
  5488. // method id "androidenterprise.enterprises.setAccount":
  5489. type EnterprisesSetAccountCall struct {
  5490. s *Service
  5491. enterpriseId string
  5492. enterpriseaccount *EnterpriseAccount
  5493. urlParams_ gensupport.URLParams
  5494. ctx_ context.Context
  5495. header_ http.Header
  5496. }
  5497. // SetAccount: Sets the account that will be used to authenticate to the
  5498. // API as the enterprise.
  5499. func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall {
  5500. c := &EnterprisesSetAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5501. c.enterpriseId = enterpriseId
  5502. c.enterpriseaccount = enterpriseaccount
  5503. return c
  5504. }
  5505. // Fields allows partial responses to be retrieved. See
  5506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5507. // for more information.
  5508. func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall {
  5509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5510. return c
  5511. }
  5512. // Context sets the context to be used in this call's Do method. Any
  5513. // pending HTTP request will be aborted if the provided context is
  5514. // canceled.
  5515. func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall {
  5516. c.ctx_ = ctx
  5517. return c
  5518. }
  5519. // Header returns an http.Header that can be modified by the caller to
  5520. // add HTTP headers to the request.
  5521. func (c *EnterprisesSetAccountCall) Header() http.Header {
  5522. if c.header_ == nil {
  5523. c.header_ = make(http.Header)
  5524. }
  5525. return c.header_
  5526. }
  5527. func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) {
  5528. reqHeaders := make(http.Header)
  5529. for k, v := range c.header_ {
  5530. reqHeaders[k] = v
  5531. }
  5532. reqHeaders.Set("User-Agent", c.s.userAgent())
  5533. var body io.Reader = nil
  5534. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount)
  5535. if err != nil {
  5536. return nil, err
  5537. }
  5538. reqHeaders.Set("Content-Type", "application/json")
  5539. c.urlParams_.Set("alt", alt)
  5540. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/account")
  5541. urls += "?" + c.urlParams_.Encode()
  5542. req, _ := http.NewRequest("PUT", urls, body)
  5543. req.Header = reqHeaders
  5544. googleapi.Expand(req.URL, map[string]string{
  5545. "enterpriseId": c.enterpriseId,
  5546. })
  5547. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5548. }
  5549. // Do executes the "androidenterprise.enterprises.setAccount" call.
  5550. // Exactly one of *EnterpriseAccount or error will be non-nil. Any
  5551. // non-2xx status code is an error. Response headers are in either
  5552. // *EnterpriseAccount.ServerResponse.Header or (if a response was
  5553. // returned at all) in error.(*googleapi.Error).Header. Use
  5554. // googleapi.IsNotModified to check whether the returned error was
  5555. // because http.StatusNotModified was returned.
  5556. func (c *EnterprisesSetAccountCall) Do(opts ...googleapi.CallOption) (*EnterpriseAccount, error) {
  5557. gensupport.SetOptions(c.urlParams_, opts...)
  5558. res, err := c.doRequest("json")
  5559. if res != nil && res.StatusCode == http.StatusNotModified {
  5560. if res.Body != nil {
  5561. res.Body.Close()
  5562. }
  5563. return nil, &googleapi.Error{
  5564. Code: res.StatusCode,
  5565. Header: res.Header,
  5566. }
  5567. }
  5568. if err != nil {
  5569. return nil, err
  5570. }
  5571. defer googleapi.CloseBody(res)
  5572. if err := googleapi.CheckResponse(res); err != nil {
  5573. return nil, err
  5574. }
  5575. ret := &EnterpriseAccount{
  5576. ServerResponse: googleapi.ServerResponse{
  5577. Header: res.Header,
  5578. HTTPStatusCode: res.StatusCode,
  5579. },
  5580. }
  5581. target := &ret
  5582. if err := gensupport.DecodeResponse(target, res); err != nil {
  5583. return nil, err
  5584. }
  5585. return ret, nil
  5586. // {
  5587. // "description": "Sets the account that will be used to authenticate to the API as the enterprise.",
  5588. // "httpMethod": "PUT",
  5589. // "id": "androidenterprise.enterprises.setAccount",
  5590. // "parameterOrder": [
  5591. // "enterpriseId"
  5592. // ],
  5593. // "parameters": {
  5594. // "enterpriseId": {
  5595. // "description": "The ID of the enterprise.",
  5596. // "location": "path",
  5597. // "required": true,
  5598. // "type": "string"
  5599. // }
  5600. // },
  5601. // "path": "enterprises/{enterpriseId}/account",
  5602. // "request": {
  5603. // "$ref": "EnterpriseAccount"
  5604. // },
  5605. // "response": {
  5606. // "$ref": "EnterpriseAccount"
  5607. // },
  5608. // "scopes": [
  5609. // "https://www.googleapis.com/auth/androidenterprise"
  5610. // ]
  5611. // }
  5612. }
  5613. // method id "androidenterprise.enterprises.setAndroidDevicePolicyConfig":
  5614. type EnterprisesSetAndroidDevicePolicyConfigCall struct {
  5615. s *Service
  5616. enterpriseId string
  5617. androiddevicepolicyconfig *AndroidDevicePolicyConfig
  5618. urlParams_ gensupport.URLParams
  5619. ctx_ context.Context
  5620. header_ http.Header
  5621. }
  5622. // SetAndroidDevicePolicyConfig: Deprecated and unused.
  5623. func (r *EnterprisesService) SetAndroidDevicePolicyConfig(enterpriseId string, androiddevicepolicyconfig *AndroidDevicePolicyConfig) *EnterprisesSetAndroidDevicePolicyConfigCall {
  5624. c := &EnterprisesSetAndroidDevicePolicyConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5625. c.enterpriseId = enterpriseId
  5626. c.androiddevicepolicyconfig = androiddevicepolicyconfig
  5627. return c
  5628. }
  5629. // Fields allows partial responses to be retrieved. See
  5630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5631. // for more information.
  5632. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Fields(s ...googleapi.Field) *EnterprisesSetAndroidDevicePolicyConfigCall {
  5633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5634. return c
  5635. }
  5636. // Context sets the context to be used in this call's Do method. Any
  5637. // pending HTTP request will be aborted if the provided context is
  5638. // canceled.
  5639. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Context(ctx context.Context) *EnterprisesSetAndroidDevicePolicyConfigCall {
  5640. c.ctx_ = ctx
  5641. return c
  5642. }
  5643. // Header returns an http.Header that can be modified by the caller to
  5644. // add HTTP headers to the request.
  5645. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Header() http.Header {
  5646. if c.header_ == nil {
  5647. c.header_ = make(http.Header)
  5648. }
  5649. return c.header_
  5650. }
  5651. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) doRequest(alt string) (*http.Response, error) {
  5652. reqHeaders := make(http.Header)
  5653. for k, v := range c.header_ {
  5654. reqHeaders[k] = v
  5655. }
  5656. reqHeaders.Set("User-Agent", c.s.userAgent())
  5657. var body io.Reader = nil
  5658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.androiddevicepolicyconfig)
  5659. if err != nil {
  5660. return nil, err
  5661. }
  5662. reqHeaders.Set("Content-Type", "application/json")
  5663. c.urlParams_.Set("alt", alt)
  5664. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/androidDevicePolicyConfig")
  5665. urls += "?" + c.urlParams_.Encode()
  5666. req, _ := http.NewRequest("PUT", urls, body)
  5667. req.Header = reqHeaders
  5668. googleapi.Expand(req.URL, map[string]string{
  5669. "enterpriseId": c.enterpriseId,
  5670. })
  5671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5672. }
  5673. // Do executes the "androidenterprise.enterprises.setAndroidDevicePolicyConfig" call.
  5674. // Exactly one of *AndroidDevicePolicyConfig or error will be non-nil.
  5675. // Any non-2xx status code is an error. Response headers are in either
  5676. // *AndroidDevicePolicyConfig.ServerResponse.Header or (if a response
  5677. // was returned at all) in error.(*googleapi.Error).Header. Use
  5678. // googleapi.IsNotModified to check whether the returned error was
  5679. // because http.StatusNotModified was returned.
  5680. func (c *EnterprisesSetAndroidDevicePolicyConfigCall) Do(opts ...googleapi.CallOption) (*AndroidDevicePolicyConfig, error) {
  5681. gensupport.SetOptions(c.urlParams_, opts...)
  5682. res, err := c.doRequest("json")
  5683. if res != nil && res.StatusCode == http.StatusNotModified {
  5684. if res.Body != nil {
  5685. res.Body.Close()
  5686. }
  5687. return nil, &googleapi.Error{
  5688. Code: res.StatusCode,
  5689. Header: res.Header,
  5690. }
  5691. }
  5692. if err != nil {
  5693. return nil, err
  5694. }
  5695. defer googleapi.CloseBody(res)
  5696. if err := googleapi.CheckResponse(res); err != nil {
  5697. return nil, err
  5698. }
  5699. ret := &AndroidDevicePolicyConfig{
  5700. ServerResponse: googleapi.ServerResponse{
  5701. Header: res.Header,
  5702. HTTPStatusCode: res.StatusCode,
  5703. },
  5704. }
  5705. target := &ret
  5706. if err := gensupport.DecodeResponse(target, res); err != nil {
  5707. return nil, err
  5708. }
  5709. return ret, nil
  5710. // {
  5711. // "description": "Deprecated and unused.",
  5712. // "httpMethod": "PUT",
  5713. // "id": "androidenterprise.enterprises.setAndroidDevicePolicyConfig",
  5714. // "parameterOrder": [
  5715. // "enterpriseId"
  5716. // ],
  5717. // "parameters": {
  5718. // "enterpriseId": {
  5719. // "description": "The ID of the enterprise.",
  5720. // "location": "path",
  5721. // "required": true,
  5722. // "type": "string"
  5723. // }
  5724. // },
  5725. // "path": "enterprises/{enterpriseId}/androidDevicePolicyConfig",
  5726. // "request": {
  5727. // "$ref": "AndroidDevicePolicyConfig"
  5728. // },
  5729. // "response": {
  5730. // "$ref": "AndroidDevicePolicyConfig"
  5731. // },
  5732. // "scopes": [
  5733. // "https://www.googleapis.com/auth/androidenterprise"
  5734. // ]
  5735. // }
  5736. }
  5737. // method id "androidenterprise.enterprises.setStoreLayout":
  5738. type EnterprisesSetStoreLayoutCall struct {
  5739. s *Service
  5740. enterpriseId string
  5741. storelayout *StoreLayout
  5742. urlParams_ gensupport.URLParams
  5743. ctx_ context.Context
  5744. header_ http.Header
  5745. }
  5746. // SetStoreLayout: Sets the store layout for the enterprise. By default,
  5747. // storeLayoutType is set to "basic" and the basic store layout is
  5748. // enabled. The basic layout only contains apps approved by the admin,
  5749. // and that have been added to the available product set for a user
  5750. // (using the setAvailableProductSet call). Apps on the page are sorted
  5751. // in order of their product ID value. If you create a custom store
  5752. // layout (by setting storeLayoutType = "custom" and setting a
  5753. // homepage), the basic store layout is disabled.
  5754. func (r *EnterprisesService) SetStoreLayout(enterpriseId string, storelayout *StoreLayout) *EnterprisesSetStoreLayoutCall {
  5755. c := &EnterprisesSetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5756. c.enterpriseId = enterpriseId
  5757. c.storelayout = storelayout
  5758. return c
  5759. }
  5760. // Fields allows partial responses to be retrieved. See
  5761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5762. // for more information.
  5763. func (c *EnterprisesSetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesSetStoreLayoutCall {
  5764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5765. return c
  5766. }
  5767. // Context sets the context to be used in this call's Do method. Any
  5768. // pending HTTP request will be aborted if the provided context is
  5769. // canceled.
  5770. func (c *EnterprisesSetStoreLayoutCall) Context(ctx context.Context) *EnterprisesSetStoreLayoutCall {
  5771. c.ctx_ = ctx
  5772. return c
  5773. }
  5774. // Header returns an http.Header that can be modified by the caller to
  5775. // add HTTP headers to the request.
  5776. func (c *EnterprisesSetStoreLayoutCall) Header() http.Header {
  5777. if c.header_ == nil {
  5778. c.header_ = make(http.Header)
  5779. }
  5780. return c.header_
  5781. }
  5782. func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) {
  5783. reqHeaders := make(http.Header)
  5784. for k, v := range c.header_ {
  5785. reqHeaders[k] = v
  5786. }
  5787. reqHeaders.Set("User-Agent", c.s.userAgent())
  5788. var body io.Reader = nil
  5789. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout)
  5790. if err != nil {
  5791. return nil, err
  5792. }
  5793. reqHeaders.Set("Content-Type", "application/json")
  5794. c.urlParams_.Set("alt", alt)
  5795. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout")
  5796. urls += "?" + c.urlParams_.Encode()
  5797. req, _ := http.NewRequest("PUT", urls, body)
  5798. req.Header = reqHeaders
  5799. googleapi.Expand(req.URL, map[string]string{
  5800. "enterpriseId": c.enterpriseId,
  5801. })
  5802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5803. }
  5804. // Do executes the "androidenterprise.enterprises.setStoreLayout" call.
  5805. // Exactly one of *StoreLayout or error will be non-nil. Any non-2xx
  5806. // status code is an error. Response headers are in either
  5807. // *StoreLayout.ServerResponse.Header or (if a response was returned at
  5808. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5809. // to check whether the returned error was because
  5810. // http.StatusNotModified was returned.
  5811. func (c *EnterprisesSetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) {
  5812. gensupport.SetOptions(c.urlParams_, opts...)
  5813. res, err := c.doRequest("json")
  5814. if res != nil && res.StatusCode == http.StatusNotModified {
  5815. if res.Body != nil {
  5816. res.Body.Close()
  5817. }
  5818. return nil, &googleapi.Error{
  5819. Code: res.StatusCode,
  5820. Header: res.Header,
  5821. }
  5822. }
  5823. if err != nil {
  5824. return nil, err
  5825. }
  5826. defer googleapi.CloseBody(res)
  5827. if err := googleapi.CheckResponse(res); err != nil {
  5828. return nil, err
  5829. }
  5830. ret := &StoreLayout{
  5831. ServerResponse: googleapi.ServerResponse{
  5832. Header: res.Header,
  5833. HTTPStatusCode: res.StatusCode,
  5834. },
  5835. }
  5836. target := &ret
  5837. if err := gensupport.DecodeResponse(target, res); err != nil {
  5838. return nil, err
  5839. }
  5840. return ret, nil
  5841. // {
  5842. // "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.",
  5843. // "httpMethod": "PUT",
  5844. // "id": "androidenterprise.enterprises.setStoreLayout",
  5845. // "parameterOrder": [
  5846. // "enterpriseId"
  5847. // ],
  5848. // "parameters": {
  5849. // "enterpriseId": {
  5850. // "description": "The ID of the enterprise.",
  5851. // "location": "path",
  5852. // "required": true,
  5853. // "type": "string"
  5854. // }
  5855. // },
  5856. // "path": "enterprises/{enterpriseId}/storeLayout",
  5857. // "request": {
  5858. // "$ref": "StoreLayout"
  5859. // },
  5860. // "response": {
  5861. // "$ref": "StoreLayout"
  5862. // },
  5863. // "scopes": [
  5864. // "https://www.googleapis.com/auth/androidenterprise"
  5865. // ]
  5866. // }
  5867. }
  5868. // method id "androidenterprise.enterprises.unenroll":
  5869. type EnterprisesUnenrollCall struct {
  5870. s *Service
  5871. enterpriseId string
  5872. urlParams_ gensupport.URLParams
  5873. ctx_ context.Context
  5874. header_ http.Header
  5875. }
  5876. // Unenroll: Unenrolls an enterprise from the calling EMM.
  5877. func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall {
  5878. c := &EnterprisesUnenrollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5879. c.enterpriseId = enterpriseId
  5880. return c
  5881. }
  5882. // Fields allows partial responses to be retrieved. See
  5883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5884. // for more information.
  5885. func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall {
  5886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5887. return c
  5888. }
  5889. // Context sets the context to be used in this call's Do method. Any
  5890. // pending HTTP request will be aborted if the provided context is
  5891. // canceled.
  5892. func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall {
  5893. c.ctx_ = ctx
  5894. return c
  5895. }
  5896. // Header returns an http.Header that can be modified by the caller to
  5897. // add HTTP headers to the request.
  5898. func (c *EnterprisesUnenrollCall) Header() http.Header {
  5899. if c.header_ == nil {
  5900. c.header_ = make(http.Header)
  5901. }
  5902. return c.header_
  5903. }
  5904. func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) {
  5905. reqHeaders := make(http.Header)
  5906. for k, v := range c.header_ {
  5907. reqHeaders[k] = v
  5908. }
  5909. reqHeaders.Set("User-Agent", c.s.userAgent())
  5910. var body io.Reader = nil
  5911. c.urlParams_.Set("alt", alt)
  5912. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/unenroll")
  5913. urls += "?" + c.urlParams_.Encode()
  5914. req, _ := http.NewRequest("POST", urls, body)
  5915. req.Header = reqHeaders
  5916. googleapi.Expand(req.URL, map[string]string{
  5917. "enterpriseId": c.enterpriseId,
  5918. })
  5919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5920. }
  5921. // Do executes the "androidenterprise.enterprises.unenroll" call.
  5922. func (c *EnterprisesUnenrollCall) Do(opts ...googleapi.CallOption) error {
  5923. gensupport.SetOptions(c.urlParams_, opts...)
  5924. res, err := c.doRequest("json")
  5925. if err != nil {
  5926. return err
  5927. }
  5928. defer googleapi.CloseBody(res)
  5929. if err := googleapi.CheckResponse(res); err != nil {
  5930. return err
  5931. }
  5932. return nil
  5933. // {
  5934. // "description": "Unenrolls an enterprise from the calling EMM.",
  5935. // "httpMethod": "POST",
  5936. // "id": "androidenterprise.enterprises.unenroll",
  5937. // "parameterOrder": [
  5938. // "enterpriseId"
  5939. // ],
  5940. // "parameters": {
  5941. // "enterpriseId": {
  5942. // "description": "The ID of the enterprise.",
  5943. // "location": "path",
  5944. // "required": true,
  5945. // "type": "string"
  5946. // }
  5947. // },
  5948. // "path": "enterprises/{enterpriseId}/unenroll",
  5949. // "scopes": [
  5950. // "https://www.googleapis.com/auth/androidenterprise"
  5951. // ]
  5952. // }
  5953. }
  5954. // method id "androidenterprise.entitlements.delete":
  5955. type EntitlementsDeleteCall struct {
  5956. s *Service
  5957. enterpriseId string
  5958. userId string
  5959. entitlementId string
  5960. urlParams_ gensupport.URLParams
  5961. ctx_ context.Context
  5962. header_ http.Header
  5963. }
  5964. // Delete: Removes an entitlement to an app for a user.
  5965. func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall {
  5966. c := &EntitlementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5967. c.enterpriseId = enterpriseId
  5968. c.userId = userId
  5969. c.entitlementId = entitlementId
  5970. return c
  5971. }
  5972. // Fields allows partial responses to be retrieved. See
  5973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5974. // for more information.
  5975. func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall {
  5976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5977. return c
  5978. }
  5979. // Context sets the context to be used in this call's Do method. Any
  5980. // pending HTTP request will be aborted if the provided context is
  5981. // canceled.
  5982. func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall {
  5983. c.ctx_ = ctx
  5984. return c
  5985. }
  5986. // Header returns an http.Header that can be modified by the caller to
  5987. // add HTTP headers to the request.
  5988. func (c *EntitlementsDeleteCall) Header() http.Header {
  5989. if c.header_ == nil {
  5990. c.header_ = make(http.Header)
  5991. }
  5992. return c.header_
  5993. }
  5994. func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5995. reqHeaders := make(http.Header)
  5996. for k, v := range c.header_ {
  5997. reqHeaders[k] = v
  5998. }
  5999. reqHeaders.Set("User-Agent", c.s.userAgent())
  6000. var body io.Reader = nil
  6001. c.urlParams_.Set("alt", alt)
  6002. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6003. urls += "?" + c.urlParams_.Encode()
  6004. req, _ := http.NewRequest("DELETE", urls, body)
  6005. req.Header = reqHeaders
  6006. googleapi.Expand(req.URL, map[string]string{
  6007. "enterpriseId": c.enterpriseId,
  6008. "userId": c.userId,
  6009. "entitlementId": c.entitlementId,
  6010. })
  6011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6012. }
  6013. // Do executes the "androidenterprise.entitlements.delete" call.
  6014. func (c *EntitlementsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6015. gensupport.SetOptions(c.urlParams_, opts...)
  6016. res, err := c.doRequest("json")
  6017. if err != nil {
  6018. return err
  6019. }
  6020. defer googleapi.CloseBody(res)
  6021. if err := googleapi.CheckResponse(res); err != nil {
  6022. return err
  6023. }
  6024. return nil
  6025. // {
  6026. // "description": "Removes an entitlement to an app for a user.",
  6027. // "httpMethod": "DELETE",
  6028. // "id": "androidenterprise.entitlements.delete",
  6029. // "parameterOrder": [
  6030. // "enterpriseId",
  6031. // "userId",
  6032. // "entitlementId"
  6033. // ],
  6034. // "parameters": {
  6035. // "enterpriseId": {
  6036. // "description": "The ID of the enterprise.",
  6037. // "location": "path",
  6038. // "required": true,
  6039. // "type": "string"
  6040. // },
  6041. // "entitlementId": {
  6042. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6043. // "location": "path",
  6044. // "required": true,
  6045. // "type": "string"
  6046. // },
  6047. // "userId": {
  6048. // "description": "The ID of the user.",
  6049. // "location": "path",
  6050. // "required": true,
  6051. // "type": "string"
  6052. // }
  6053. // },
  6054. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6055. // "scopes": [
  6056. // "https://www.googleapis.com/auth/androidenterprise"
  6057. // ]
  6058. // }
  6059. }
  6060. // method id "androidenterprise.entitlements.get":
  6061. type EntitlementsGetCall struct {
  6062. s *Service
  6063. enterpriseId string
  6064. userId string
  6065. entitlementId string
  6066. urlParams_ gensupport.URLParams
  6067. ifNoneMatch_ string
  6068. ctx_ context.Context
  6069. header_ http.Header
  6070. }
  6071. // Get: Retrieves details of an entitlement.
  6072. func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall {
  6073. c := &EntitlementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6074. c.enterpriseId = enterpriseId
  6075. c.userId = userId
  6076. c.entitlementId = entitlementId
  6077. return c
  6078. }
  6079. // Fields allows partial responses to be retrieved. See
  6080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6081. // for more information.
  6082. func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall {
  6083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6084. return c
  6085. }
  6086. // IfNoneMatch sets the optional parameter which makes the operation
  6087. // fail if the object's ETag matches the given value. This is useful for
  6088. // getting updates only after the object has changed since the last
  6089. // request. Use googleapi.IsNotModified to check whether the response
  6090. // error from Do is the result of In-None-Match.
  6091. func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall {
  6092. c.ifNoneMatch_ = entityTag
  6093. return c
  6094. }
  6095. // Context sets the context to be used in this call's Do method. Any
  6096. // pending HTTP request will be aborted if the provided context is
  6097. // canceled.
  6098. func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall {
  6099. c.ctx_ = ctx
  6100. return c
  6101. }
  6102. // Header returns an http.Header that can be modified by the caller to
  6103. // add HTTP headers to the request.
  6104. func (c *EntitlementsGetCall) Header() http.Header {
  6105. if c.header_ == nil {
  6106. c.header_ = make(http.Header)
  6107. }
  6108. return c.header_
  6109. }
  6110. func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) {
  6111. reqHeaders := make(http.Header)
  6112. for k, v := range c.header_ {
  6113. reqHeaders[k] = v
  6114. }
  6115. reqHeaders.Set("User-Agent", c.s.userAgent())
  6116. if c.ifNoneMatch_ != "" {
  6117. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6118. }
  6119. var body io.Reader = nil
  6120. c.urlParams_.Set("alt", alt)
  6121. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6122. urls += "?" + c.urlParams_.Encode()
  6123. req, _ := http.NewRequest("GET", urls, body)
  6124. req.Header = reqHeaders
  6125. googleapi.Expand(req.URL, map[string]string{
  6126. "enterpriseId": c.enterpriseId,
  6127. "userId": c.userId,
  6128. "entitlementId": c.entitlementId,
  6129. })
  6130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6131. }
  6132. // Do executes the "androidenterprise.entitlements.get" call.
  6133. // Exactly one of *Entitlement or error will be non-nil. Any non-2xx
  6134. // status code is an error. Response headers are in either
  6135. // *Entitlement.ServerResponse.Header or (if a response was returned at
  6136. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6137. // to check whether the returned error was because
  6138. // http.StatusNotModified was returned.
  6139. func (c *EntitlementsGetCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
  6140. gensupport.SetOptions(c.urlParams_, opts...)
  6141. res, err := c.doRequest("json")
  6142. if res != nil && res.StatusCode == http.StatusNotModified {
  6143. if res.Body != nil {
  6144. res.Body.Close()
  6145. }
  6146. return nil, &googleapi.Error{
  6147. Code: res.StatusCode,
  6148. Header: res.Header,
  6149. }
  6150. }
  6151. if err != nil {
  6152. return nil, err
  6153. }
  6154. defer googleapi.CloseBody(res)
  6155. if err := googleapi.CheckResponse(res); err != nil {
  6156. return nil, err
  6157. }
  6158. ret := &Entitlement{
  6159. ServerResponse: googleapi.ServerResponse{
  6160. Header: res.Header,
  6161. HTTPStatusCode: res.StatusCode,
  6162. },
  6163. }
  6164. target := &ret
  6165. if err := gensupport.DecodeResponse(target, res); err != nil {
  6166. return nil, err
  6167. }
  6168. return ret, nil
  6169. // {
  6170. // "description": "Retrieves details of an entitlement.",
  6171. // "httpMethod": "GET",
  6172. // "id": "androidenterprise.entitlements.get",
  6173. // "parameterOrder": [
  6174. // "enterpriseId",
  6175. // "userId",
  6176. // "entitlementId"
  6177. // ],
  6178. // "parameters": {
  6179. // "enterpriseId": {
  6180. // "description": "The ID of the enterprise.",
  6181. // "location": "path",
  6182. // "required": true,
  6183. // "type": "string"
  6184. // },
  6185. // "entitlementId": {
  6186. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6187. // "location": "path",
  6188. // "required": true,
  6189. // "type": "string"
  6190. // },
  6191. // "userId": {
  6192. // "description": "The ID of the user.",
  6193. // "location": "path",
  6194. // "required": true,
  6195. // "type": "string"
  6196. // }
  6197. // },
  6198. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6199. // "response": {
  6200. // "$ref": "Entitlement"
  6201. // },
  6202. // "scopes": [
  6203. // "https://www.googleapis.com/auth/androidenterprise"
  6204. // ]
  6205. // }
  6206. }
  6207. // method id "androidenterprise.entitlements.list":
  6208. type EntitlementsListCall struct {
  6209. s *Service
  6210. enterpriseId string
  6211. userId string
  6212. urlParams_ gensupport.URLParams
  6213. ifNoneMatch_ string
  6214. ctx_ context.Context
  6215. header_ http.Header
  6216. }
  6217. // List: Lists all entitlements for the specified user. Only the ID is
  6218. // set.
  6219. func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall {
  6220. c := &EntitlementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6221. c.enterpriseId = enterpriseId
  6222. c.userId = userId
  6223. return c
  6224. }
  6225. // Fields allows partial responses to be retrieved. See
  6226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6227. // for more information.
  6228. func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall {
  6229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6230. return c
  6231. }
  6232. // IfNoneMatch sets the optional parameter which makes the operation
  6233. // fail if the object's ETag matches the given value. This is useful for
  6234. // getting updates only after the object has changed since the last
  6235. // request. Use googleapi.IsNotModified to check whether the response
  6236. // error from Do is the result of In-None-Match.
  6237. func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall {
  6238. c.ifNoneMatch_ = entityTag
  6239. return c
  6240. }
  6241. // Context sets the context to be used in this call's Do method. Any
  6242. // pending HTTP request will be aborted if the provided context is
  6243. // canceled.
  6244. func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall {
  6245. c.ctx_ = ctx
  6246. return c
  6247. }
  6248. // Header returns an http.Header that can be modified by the caller to
  6249. // add HTTP headers to the request.
  6250. func (c *EntitlementsListCall) Header() http.Header {
  6251. if c.header_ == nil {
  6252. c.header_ = make(http.Header)
  6253. }
  6254. return c.header_
  6255. }
  6256. func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) {
  6257. reqHeaders := make(http.Header)
  6258. for k, v := range c.header_ {
  6259. reqHeaders[k] = v
  6260. }
  6261. reqHeaders.Set("User-Agent", c.s.userAgent())
  6262. if c.ifNoneMatch_ != "" {
  6263. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6264. }
  6265. var body io.Reader = nil
  6266. c.urlParams_.Set("alt", alt)
  6267. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements")
  6268. urls += "?" + c.urlParams_.Encode()
  6269. req, _ := http.NewRequest("GET", urls, body)
  6270. req.Header = reqHeaders
  6271. googleapi.Expand(req.URL, map[string]string{
  6272. "enterpriseId": c.enterpriseId,
  6273. "userId": c.userId,
  6274. })
  6275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6276. }
  6277. // Do executes the "androidenterprise.entitlements.list" call.
  6278. // Exactly one of *EntitlementsListResponse or error will be non-nil.
  6279. // Any non-2xx status code is an error. Response headers are in either
  6280. // *EntitlementsListResponse.ServerResponse.Header or (if a response was
  6281. // returned at all) in error.(*googleapi.Error).Header. Use
  6282. // googleapi.IsNotModified to check whether the returned error was
  6283. // because http.StatusNotModified was returned.
  6284. func (c *EntitlementsListCall) Do(opts ...googleapi.CallOption) (*EntitlementsListResponse, error) {
  6285. gensupport.SetOptions(c.urlParams_, opts...)
  6286. res, err := c.doRequest("json")
  6287. if res != nil && res.StatusCode == http.StatusNotModified {
  6288. if res.Body != nil {
  6289. res.Body.Close()
  6290. }
  6291. return nil, &googleapi.Error{
  6292. Code: res.StatusCode,
  6293. Header: res.Header,
  6294. }
  6295. }
  6296. if err != nil {
  6297. return nil, err
  6298. }
  6299. defer googleapi.CloseBody(res)
  6300. if err := googleapi.CheckResponse(res); err != nil {
  6301. return nil, err
  6302. }
  6303. ret := &EntitlementsListResponse{
  6304. ServerResponse: googleapi.ServerResponse{
  6305. Header: res.Header,
  6306. HTTPStatusCode: res.StatusCode,
  6307. },
  6308. }
  6309. target := &ret
  6310. if err := gensupport.DecodeResponse(target, res); err != nil {
  6311. return nil, err
  6312. }
  6313. return ret, nil
  6314. // {
  6315. // "description": "Lists all entitlements for the specified user. Only the ID is set.",
  6316. // "httpMethod": "GET",
  6317. // "id": "androidenterprise.entitlements.list",
  6318. // "parameterOrder": [
  6319. // "enterpriseId",
  6320. // "userId"
  6321. // ],
  6322. // "parameters": {
  6323. // "enterpriseId": {
  6324. // "description": "The ID of the enterprise.",
  6325. // "location": "path",
  6326. // "required": true,
  6327. // "type": "string"
  6328. // },
  6329. // "userId": {
  6330. // "description": "The ID of the user.",
  6331. // "location": "path",
  6332. // "required": true,
  6333. // "type": "string"
  6334. // }
  6335. // },
  6336. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements",
  6337. // "response": {
  6338. // "$ref": "EntitlementsListResponse"
  6339. // },
  6340. // "scopes": [
  6341. // "https://www.googleapis.com/auth/androidenterprise"
  6342. // ]
  6343. // }
  6344. }
  6345. // method id "androidenterprise.entitlements.patch":
  6346. type EntitlementsPatchCall struct {
  6347. s *Service
  6348. enterpriseId string
  6349. userId string
  6350. entitlementId string
  6351. entitlement *Entitlement
  6352. urlParams_ gensupport.URLParams
  6353. ctx_ context.Context
  6354. header_ http.Header
  6355. }
  6356. // Patch: Adds or updates an entitlement to an app for a user. This
  6357. // method supports patch semantics.
  6358. func (r *EntitlementsService) Patch(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsPatchCall {
  6359. c := &EntitlementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6360. c.enterpriseId = enterpriseId
  6361. c.userId = userId
  6362. c.entitlementId = entitlementId
  6363. c.entitlement = entitlement
  6364. return c
  6365. }
  6366. // Install sets the optional parameter "install": Set to true to also
  6367. // install the product on all the user's devices where possible. Failure
  6368. // to install on one or more devices will not prevent this operation
  6369. // from returning successfully, as long as the entitlement was
  6370. // successfully assigned to the user.
  6371. func (c *EntitlementsPatchCall) Install(install bool) *EntitlementsPatchCall {
  6372. c.urlParams_.Set("install", fmt.Sprint(install))
  6373. return c
  6374. }
  6375. // Fields allows partial responses to be retrieved. See
  6376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6377. // for more information.
  6378. func (c *EntitlementsPatchCall) Fields(s ...googleapi.Field) *EntitlementsPatchCall {
  6379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6380. return c
  6381. }
  6382. // Context sets the context to be used in this call's Do method. Any
  6383. // pending HTTP request will be aborted if the provided context is
  6384. // canceled.
  6385. func (c *EntitlementsPatchCall) Context(ctx context.Context) *EntitlementsPatchCall {
  6386. c.ctx_ = ctx
  6387. return c
  6388. }
  6389. // Header returns an http.Header that can be modified by the caller to
  6390. // add HTTP headers to the request.
  6391. func (c *EntitlementsPatchCall) Header() http.Header {
  6392. if c.header_ == nil {
  6393. c.header_ = make(http.Header)
  6394. }
  6395. return c.header_
  6396. }
  6397. func (c *EntitlementsPatchCall) doRequest(alt string) (*http.Response, error) {
  6398. reqHeaders := make(http.Header)
  6399. for k, v := range c.header_ {
  6400. reqHeaders[k] = v
  6401. }
  6402. reqHeaders.Set("User-Agent", c.s.userAgent())
  6403. var body io.Reader = nil
  6404. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
  6405. if err != nil {
  6406. return nil, err
  6407. }
  6408. reqHeaders.Set("Content-Type", "application/json")
  6409. c.urlParams_.Set("alt", alt)
  6410. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6411. urls += "?" + c.urlParams_.Encode()
  6412. req, _ := http.NewRequest("PATCH", urls, body)
  6413. req.Header = reqHeaders
  6414. googleapi.Expand(req.URL, map[string]string{
  6415. "enterpriseId": c.enterpriseId,
  6416. "userId": c.userId,
  6417. "entitlementId": c.entitlementId,
  6418. })
  6419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6420. }
  6421. // Do executes the "androidenterprise.entitlements.patch" call.
  6422. // Exactly one of *Entitlement or error will be non-nil. Any non-2xx
  6423. // status code is an error. Response headers are in either
  6424. // *Entitlement.ServerResponse.Header or (if a response was returned at
  6425. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6426. // to check whether the returned error was because
  6427. // http.StatusNotModified was returned.
  6428. func (c *EntitlementsPatchCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
  6429. gensupport.SetOptions(c.urlParams_, opts...)
  6430. res, err := c.doRequest("json")
  6431. if res != nil && res.StatusCode == http.StatusNotModified {
  6432. if res.Body != nil {
  6433. res.Body.Close()
  6434. }
  6435. return nil, &googleapi.Error{
  6436. Code: res.StatusCode,
  6437. Header: res.Header,
  6438. }
  6439. }
  6440. if err != nil {
  6441. return nil, err
  6442. }
  6443. defer googleapi.CloseBody(res)
  6444. if err := googleapi.CheckResponse(res); err != nil {
  6445. return nil, err
  6446. }
  6447. ret := &Entitlement{
  6448. ServerResponse: googleapi.ServerResponse{
  6449. Header: res.Header,
  6450. HTTPStatusCode: res.StatusCode,
  6451. },
  6452. }
  6453. target := &ret
  6454. if err := gensupport.DecodeResponse(target, res); err != nil {
  6455. return nil, err
  6456. }
  6457. return ret, nil
  6458. // {
  6459. // "description": "Adds or updates an entitlement to an app for a user. This method supports patch semantics.",
  6460. // "httpMethod": "PATCH",
  6461. // "id": "androidenterprise.entitlements.patch",
  6462. // "parameterOrder": [
  6463. // "enterpriseId",
  6464. // "userId",
  6465. // "entitlementId"
  6466. // ],
  6467. // "parameters": {
  6468. // "enterpriseId": {
  6469. // "description": "The ID of the enterprise.",
  6470. // "location": "path",
  6471. // "required": true,
  6472. // "type": "string"
  6473. // },
  6474. // "entitlementId": {
  6475. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6476. // "location": "path",
  6477. // "required": true,
  6478. // "type": "string"
  6479. // },
  6480. // "install": {
  6481. // "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.",
  6482. // "location": "query",
  6483. // "type": "boolean"
  6484. // },
  6485. // "userId": {
  6486. // "description": "The ID of the user.",
  6487. // "location": "path",
  6488. // "required": true,
  6489. // "type": "string"
  6490. // }
  6491. // },
  6492. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6493. // "request": {
  6494. // "$ref": "Entitlement"
  6495. // },
  6496. // "response": {
  6497. // "$ref": "Entitlement"
  6498. // },
  6499. // "scopes": [
  6500. // "https://www.googleapis.com/auth/androidenterprise"
  6501. // ]
  6502. // }
  6503. }
  6504. // method id "androidenterprise.entitlements.update":
  6505. type EntitlementsUpdateCall struct {
  6506. s *Service
  6507. enterpriseId string
  6508. userId string
  6509. entitlementId string
  6510. entitlement *Entitlement
  6511. urlParams_ gensupport.URLParams
  6512. ctx_ context.Context
  6513. header_ http.Header
  6514. }
  6515. // Update: Adds or updates an entitlement to an app for a user.
  6516. func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall {
  6517. c := &EntitlementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6518. c.enterpriseId = enterpriseId
  6519. c.userId = userId
  6520. c.entitlementId = entitlementId
  6521. c.entitlement = entitlement
  6522. return c
  6523. }
  6524. // Install sets the optional parameter "install": Set to true to also
  6525. // install the product on all the user's devices where possible. Failure
  6526. // to install on one or more devices will not prevent this operation
  6527. // from returning successfully, as long as the entitlement was
  6528. // successfully assigned to the user.
  6529. func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall {
  6530. c.urlParams_.Set("install", fmt.Sprint(install))
  6531. return c
  6532. }
  6533. // Fields allows partial responses to be retrieved. See
  6534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6535. // for more information.
  6536. func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall {
  6537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6538. return c
  6539. }
  6540. // Context sets the context to be used in this call's Do method. Any
  6541. // pending HTTP request will be aborted if the provided context is
  6542. // canceled.
  6543. func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall {
  6544. c.ctx_ = ctx
  6545. return c
  6546. }
  6547. // Header returns an http.Header that can be modified by the caller to
  6548. // add HTTP headers to the request.
  6549. func (c *EntitlementsUpdateCall) Header() http.Header {
  6550. if c.header_ == nil {
  6551. c.header_ = make(http.Header)
  6552. }
  6553. return c.header_
  6554. }
  6555. func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6556. reqHeaders := make(http.Header)
  6557. for k, v := range c.header_ {
  6558. reqHeaders[k] = v
  6559. }
  6560. reqHeaders.Set("User-Agent", c.s.userAgent())
  6561. var body io.Reader = nil
  6562. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
  6563. if err != nil {
  6564. return nil, err
  6565. }
  6566. reqHeaders.Set("Content-Type", "application/json")
  6567. c.urlParams_.Set("alt", alt)
  6568. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
  6569. urls += "?" + c.urlParams_.Encode()
  6570. req, _ := http.NewRequest("PUT", urls, body)
  6571. req.Header = reqHeaders
  6572. googleapi.Expand(req.URL, map[string]string{
  6573. "enterpriseId": c.enterpriseId,
  6574. "userId": c.userId,
  6575. "entitlementId": c.entitlementId,
  6576. })
  6577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6578. }
  6579. // Do executes the "androidenterprise.entitlements.update" call.
  6580. // Exactly one of *Entitlement or error will be non-nil. Any non-2xx
  6581. // status code is an error. Response headers are in either
  6582. // *Entitlement.ServerResponse.Header or (if a response was returned at
  6583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6584. // to check whether the returned error was because
  6585. // http.StatusNotModified was returned.
  6586. func (c *EntitlementsUpdateCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
  6587. gensupport.SetOptions(c.urlParams_, opts...)
  6588. res, err := c.doRequest("json")
  6589. if res != nil && res.StatusCode == http.StatusNotModified {
  6590. if res.Body != nil {
  6591. res.Body.Close()
  6592. }
  6593. return nil, &googleapi.Error{
  6594. Code: res.StatusCode,
  6595. Header: res.Header,
  6596. }
  6597. }
  6598. if err != nil {
  6599. return nil, err
  6600. }
  6601. defer googleapi.CloseBody(res)
  6602. if err := googleapi.CheckResponse(res); err != nil {
  6603. return nil, err
  6604. }
  6605. ret := &Entitlement{
  6606. ServerResponse: googleapi.ServerResponse{
  6607. Header: res.Header,
  6608. HTTPStatusCode: res.StatusCode,
  6609. },
  6610. }
  6611. target := &ret
  6612. if err := gensupport.DecodeResponse(target, res); err != nil {
  6613. return nil, err
  6614. }
  6615. return ret, nil
  6616. // {
  6617. // "description": "Adds or updates an entitlement to an app for a user.",
  6618. // "httpMethod": "PUT",
  6619. // "id": "androidenterprise.entitlements.update",
  6620. // "parameterOrder": [
  6621. // "enterpriseId",
  6622. // "userId",
  6623. // "entitlementId"
  6624. // ],
  6625. // "parameters": {
  6626. // "enterpriseId": {
  6627. // "description": "The ID of the enterprise.",
  6628. // "location": "path",
  6629. // "required": true,
  6630. // "type": "string"
  6631. // },
  6632. // "entitlementId": {
  6633. // "description": "The ID of the entitlement (a product ID), e.g. \"app:com.google.android.gm\".",
  6634. // "location": "path",
  6635. // "required": true,
  6636. // "type": "string"
  6637. // },
  6638. // "install": {
  6639. // "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.",
  6640. // "location": "query",
  6641. // "type": "boolean"
  6642. // },
  6643. // "userId": {
  6644. // "description": "The ID of the user.",
  6645. // "location": "path",
  6646. // "required": true,
  6647. // "type": "string"
  6648. // }
  6649. // },
  6650. // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
  6651. // "request": {
  6652. // "$ref": "Entitlement"
  6653. // },
  6654. // "response": {
  6655. // "$ref": "Entitlement"
  6656. // },
  6657. // "scopes": [
  6658. // "https://www.googleapis.com/auth/androidenterprise"
  6659. // ]
  6660. // }
  6661. }
  6662. // method id "androidenterprise.grouplicenses.get":
  6663. type GrouplicensesGetCall struct {
  6664. s *Service
  6665. enterpriseId string
  6666. groupLicenseId string
  6667. urlParams_ gensupport.URLParams
  6668. ifNoneMatch_ string
  6669. ctx_ context.Context
  6670. header_ http.Header
  6671. }
  6672. // Get: Retrieves details of an enterprise's group license for a
  6673. // product.
  6674. func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall {
  6675. c := &GrouplicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6676. c.enterpriseId = enterpriseId
  6677. c.groupLicenseId = groupLicenseId
  6678. return c
  6679. }
  6680. // Fields allows partial responses to be retrieved. See
  6681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6682. // for more information.
  6683. func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall {
  6684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6685. return c
  6686. }
  6687. // IfNoneMatch sets the optional parameter which makes the operation
  6688. // fail if the object's ETag matches the given value. This is useful for
  6689. // getting updates only after the object has changed since the last
  6690. // request. Use googleapi.IsNotModified to check whether the response
  6691. // error from Do is the result of In-None-Match.
  6692. func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall {
  6693. c.ifNoneMatch_ = entityTag
  6694. return c
  6695. }
  6696. // Context sets the context to be used in this call's Do method. Any
  6697. // pending HTTP request will be aborted if the provided context is
  6698. // canceled.
  6699. func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall {
  6700. c.ctx_ = ctx
  6701. return c
  6702. }
  6703. // Header returns an http.Header that can be modified by the caller to
  6704. // add HTTP headers to the request.
  6705. func (c *GrouplicensesGetCall) Header() http.Header {
  6706. if c.header_ == nil {
  6707. c.header_ = make(http.Header)
  6708. }
  6709. return c.header_
  6710. }
  6711. func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) {
  6712. reqHeaders := make(http.Header)
  6713. for k, v := range c.header_ {
  6714. reqHeaders[k] = v
  6715. }
  6716. reqHeaders.Set("User-Agent", c.s.userAgent())
  6717. if c.ifNoneMatch_ != "" {
  6718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6719. }
  6720. var body io.Reader = nil
  6721. c.urlParams_.Set("alt", alt)
  6722. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}")
  6723. urls += "?" + c.urlParams_.Encode()
  6724. req, _ := http.NewRequest("GET", urls, body)
  6725. req.Header = reqHeaders
  6726. googleapi.Expand(req.URL, map[string]string{
  6727. "enterpriseId": c.enterpriseId,
  6728. "groupLicenseId": c.groupLicenseId,
  6729. })
  6730. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6731. }
  6732. // Do executes the "androidenterprise.grouplicenses.get" call.
  6733. // Exactly one of *GroupLicense or error will be non-nil. Any non-2xx
  6734. // status code is an error. Response headers are in either
  6735. // *GroupLicense.ServerResponse.Header or (if a response was returned at
  6736. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6737. // to check whether the returned error was because
  6738. // http.StatusNotModified was returned.
  6739. func (c *GrouplicensesGetCall) Do(opts ...googleapi.CallOption) (*GroupLicense, error) {
  6740. gensupport.SetOptions(c.urlParams_, opts...)
  6741. res, err := c.doRequest("json")
  6742. if res != nil && res.StatusCode == http.StatusNotModified {
  6743. if res.Body != nil {
  6744. res.Body.Close()
  6745. }
  6746. return nil, &googleapi.Error{
  6747. Code: res.StatusCode,
  6748. Header: res.Header,
  6749. }
  6750. }
  6751. if err != nil {
  6752. return nil, err
  6753. }
  6754. defer googleapi.CloseBody(res)
  6755. if err := googleapi.CheckResponse(res); err != nil {
  6756. return nil, err
  6757. }
  6758. ret := &GroupLicense{
  6759. ServerResponse: googleapi.ServerResponse{
  6760. Header: res.Header,
  6761. HTTPStatusCode: res.StatusCode,
  6762. },
  6763. }
  6764. target := &ret
  6765. if err := gensupport.DecodeResponse(target, res); err != nil {
  6766. return nil, err
  6767. }
  6768. return ret, nil
  6769. // {
  6770. // "description": "Retrieves details of an enterprise's group license for a product.",
  6771. // "httpMethod": "GET",
  6772. // "id": "androidenterprise.grouplicenses.get",
  6773. // "parameterOrder": [
  6774. // "enterpriseId",
  6775. // "groupLicenseId"
  6776. // ],
  6777. // "parameters": {
  6778. // "enterpriseId": {
  6779. // "description": "The ID of the enterprise.",
  6780. // "location": "path",
  6781. // "required": true,
  6782. // "type": "string"
  6783. // },
  6784. // "groupLicenseId": {
  6785. // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
  6786. // "location": "path",
  6787. // "required": true,
  6788. // "type": "string"
  6789. // }
  6790. // },
  6791. // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}",
  6792. // "response": {
  6793. // "$ref": "GroupLicense"
  6794. // },
  6795. // "scopes": [
  6796. // "https://www.googleapis.com/auth/androidenterprise"
  6797. // ]
  6798. // }
  6799. }
  6800. // method id "androidenterprise.grouplicenses.list":
  6801. type GrouplicensesListCall struct {
  6802. s *Service
  6803. enterpriseId string
  6804. urlParams_ gensupport.URLParams
  6805. ifNoneMatch_ string
  6806. ctx_ context.Context
  6807. header_ http.Header
  6808. }
  6809. // List: Retrieves IDs of all products for which the enterprise has a
  6810. // group license.
  6811. func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall {
  6812. c := &GrouplicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6813. c.enterpriseId = enterpriseId
  6814. return c
  6815. }
  6816. // Fields allows partial responses to be retrieved. See
  6817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6818. // for more information.
  6819. func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall {
  6820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6821. return c
  6822. }
  6823. // IfNoneMatch sets the optional parameter which makes the operation
  6824. // fail if the object's ETag matches the given value. This is useful for
  6825. // getting updates only after the object has changed since the last
  6826. // request. Use googleapi.IsNotModified to check whether the response
  6827. // error from Do is the result of In-None-Match.
  6828. func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall {
  6829. c.ifNoneMatch_ = entityTag
  6830. return c
  6831. }
  6832. // Context sets the context to be used in this call's Do method. Any
  6833. // pending HTTP request will be aborted if the provided context is
  6834. // canceled.
  6835. func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall {
  6836. c.ctx_ = ctx
  6837. return c
  6838. }
  6839. // Header returns an http.Header that can be modified by the caller to
  6840. // add HTTP headers to the request.
  6841. func (c *GrouplicensesListCall) Header() http.Header {
  6842. if c.header_ == nil {
  6843. c.header_ = make(http.Header)
  6844. }
  6845. return c.header_
  6846. }
  6847. func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) {
  6848. reqHeaders := make(http.Header)
  6849. for k, v := range c.header_ {
  6850. reqHeaders[k] = v
  6851. }
  6852. reqHeaders.Set("User-Agent", c.s.userAgent())
  6853. if c.ifNoneMatch_ != "" {
  6854. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6855. }
  6856. var body io.Reader = nil
  6857. c.urlParams_.Set("alt", alt)
  6858. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses")
  6859. urls += "?" + c.urlParams_.Encode()
  6860. req, _ := http.NewRequest("GET", urls, body)
  6861. req.Header = reqHeaders
  6862. googleapi.Expand(req.URL, map[string]string{
  6863. "enterpriseId": c.enterpriseId,
  6864. })
  6865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6866. }
  6867. // Do executes the "androidenterprise.grouplicenses.list" call.
  6868. // Exactly one of *GroupLicensesListResponse or error will be non-nil.
  6869. // Any non-2xx status code is an error. Response headers are in either
  6870. // *GroupLicensesListResponse.ServerResponse.Header or (if a response
  6871. // was returned at all) in error.(*googleapi.Error).Header. Use
  6872. // googleapi.IsNotModified to check whether the returned error was
  6873. // because http.StatusNotModified was returned.
  6874. func (c *GrouplicensesListCall) Do(opts ...googleapi.CallOption) (*GroupLicensesListResponse, error) {
  6875. gensupport.SetOptions(c.urlParams_, opts...)
  6876. res, err := c.doRequest("json")
  6877. if res != nil && res.StatusCode == http.StatusNotModified {
  6878. if res.Body != nil {
  6879. res.Body.Close()
  6880. }
  6881. return nil, &googleapi.Error{
  6882. Code: res.StatusCode,
  6883. Header: res.Header,
  6884. }
  6885. }
  6886. if err != nil {
  6887. return nil, err
  6888. }
  6889. defer googleapi.CloseBody(res)
  6890. if err := googleapi.CheckResponse(res); err != nil {
  6891. return nil, err
  6892. }
  6893. ret := &GroupLicensesListResponse{
  6894. ServerResponse: googleapi.ServerResponse{
  6895. Header: res.Header,
  6896. HTTPStatusCode: res.StatusCode,
  6897. },
  6898. }
  6899. target := &ret
  6900. if err := gensupport.DecodeResponse(target, res); err != nil {
  6901. return nil, err
  6902. }
  6903. return ret, nil
  6904. // {
  6905. // "description": "Retrieves IDs of all products for which the enterprise has a group license.",
  6906. // "httpMethod": "GET",
  6907. // "id": "androidenterprise.grouplicenses.list",
  6908. // "parameterOrder": [
  6909. // "enterpriseId"
  6910. // ],
  6911. // "parameters": {
  6912. // "enterpriseId": {
  6913. // "description": "The ID of the enterprise.",
  6914. // "location": "path",
  6915. // "required": true,
  6916. // "type": "string"
  6917. // }
  6918. // },
  6919. // "path": "enterprises/{enterpriseId}/groupLicenses",
  6920. // "response": {
  6921. // "$ref": "GroupLicensesListResponse"
  6922. // },
  6923. // "scopes": [
  6924. // "https://www.googleapis.com/auth/androidenterprise"
  6925. // ]
  6926. // }
  6927. }
  6928. // method id "androidenterprise.grouplicenseusers.list":
  6929. type GrouplicenseusersListCall struct {
  6930. s *Service
  6931. enterpriseId string
  6932. groupLicenseId string
  6933. urlParams_ gensupport.URLParams
  6934. ifNoneMatch_ string
  6935. ctx_ context.Context
  6936. header_ http.Header
  6937. }
  6938. // List: Retrieves the IDs of the users who have been granted
  6939. // entitlements under the license.
  6940. func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall {
  6941. c := &GrouplicenseusersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6942. c.enterpriseId = enterpriseId
  6943. c.groupLicenseId = groupLicenseId
  6944. return c
  6945. }
  6946. // Fields allows partial responses to be retrieved. See
  6947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6948. // for more information.
  6949. func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall {
  6950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6951. return c
  6952. }
  6953. // IfNoneMatch sets the optional parameter which makes the operation
  6954. // fail if the object's ETag matches the given value. This is useful for
  6955. // getting updates only after the object has changed since the last
  6956. // request. Use googleapi.IsNotModified to check whether the response
  6957. // error from Do is the result of In-None-Match.
  6958. func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall {
  6959. c.ifNoneMatch_ = entityTag
  6960. return c
  6961. }
  6962. // Context sets the context to be used in this call's Do method. Any
  6963. // pending HTTP request will be aborted if the provided context is
  6964. // canceled.
  6965. func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall {
  6966. c.ctx_ = ctx
  6967. return c
  6968. }
  6969. // Header returns an http.Header that can be modified by the caller to
  6970. // add HTTP headers to the request.
  6971. func (c *GrouplicenseusersListCall) Header() http.Header {
  6972. if c.header_ == nil {
  6973. c.header_ = make(http.Header)
  6974. }
  6975. return c.header_
  6976. }
  6977. func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) {
  6978. reqHeaders := make(http.Header)
  6979. for k, v := range c.header_ {
  6980. reqHeaders[k] = v
  6981. }
  6982. reqHeaders.Set("User-Agent", c.s.userAgent())
  6983. if c.ifNoneMatch_ != "" {
  6984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6985. }
  6986. var body io.Reader = nil
  6987. c.urlParams_.Set("alt", alt)
  6988. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users")
  6989. urls += "?" + c.urlParams_.Encode()
  6990. req, _ := http.NewRequest("GET", urls, body)
  6991. req.Header = reqHeaders
  6992. googleapi.Expand(req.URL, map[string]string{
  6993. "enterpriseId": c.enterpriseId,
  6994. "groupLicenseId": c.groupLicenseId,
  6995. })
  6996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6997. }
  6998. // Do executes the "androidenterprise.grouplicenseusers.list" call.
  6999. // Exactly one of *GroupLicenseUsersListResponse or error will be
  7000. // non-nil. Any non-2xx status code is an error. Response headers are in
  7001. // either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a
  7002. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7003. // googleapi.IsNotModified to check whether the returned error was
  7004. // because http.StatusNotModified was returned.
  7005. func (c *GrouplicenseusersListCall) Do(opts ...googleapi.CallOption) (*GroupLicenseUsersListResponse, error) {
  7006. gensupport.SetOptions(c.urlParams_, opts...)
  7007. res, err := c.doRequest("json")
  7008. if res != nil && res.StatusCode == http.StatusNotModified {
  7009. if res.Body != nil {
  7010. res.Body.Close()
  7011. }
  7012. return nil, &googleapi.Error{
  7013. Code: res.StatusCode,
  7014. Header: res.Header,
  7015. }
  7016. }
  7017. if err != nil {
  7018. return nil, err
  7019. }
  7020. defer googleapi.CloseBody(res)
  7021. if err := googleapi.CheckResponse(res); err != nil {
  7022. return nil, err
  7023. }
  7024. ret := &GroupLicenseUsersListResponse{
  7025. ServerResponse: googleapi.ServerResponse{
  7026. Header: res.Header,
  7027. HTTPStatusCode: res.StatusCode,
  7028. },
  7029. }
  7030. target := &ret
  7031. if err := gensupport.DecodeResponse(target, res); err != nil {
  7032. return nil, err
  7033. }
  7034. return ret, nil
  7035. // {
  7036. // "description": "Retrieves the IDs of the users who have been granted entitlements under the license.",
  7037. // "httpMethod": "GET",
  7038. // "id": "androidenterprise.grouplicenseusers.list",
  7039. // "parameterOrder": [
  7040. // "enterpriseId",
  7041. // "groupLicenseId"
  7042. // ],
  7043. // "parameters": {
  7044. // "enterpriseId": {
  7045. // "description": "The ID of the enterprise.",
  7046. // "location": "path",
  7047. // "required": true,
  7048. // "type": "string"
  7049. // },
  7050. // "groupLicenseId": {
  7051. // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
  7052. // "location": "path",
  7053. // "required": true,
  7054. // "type": "string"
  7055. // }
  7056. // },
  7057. // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users",
  7058. // "response": {
  7059. // "$ref": "GroupLicenseUsersListResponse"
  7060. // },
  7061. // "scopes": [
  7062. // "https://www.googleapis.com/auth/androidenterprise"
  7063. // ]
  7064. // }
  7065. }
  7066. // method id "androidenterprise.installs.delete":
  7067. type InstallsDeleteCall struct {
  7068. s *Service
  7069. enterpriseId string
  7070. userId string
  7071. deviceId string
  7072. installId string
  7073. urlParams_ gensupport.URLParams
  7074. ctx_ context.Context
  7075. header_ http.Header
  7076. }
  7077. // Delete: Requests to remove an app from a device. A call to get or
  7078. // list will still show the app as installed on the device until it is
  7079. // actually removed.
  7080. func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall {
  7081. c := &InstallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7082. c.enterpriseId = enterpriseId
  7083. c.userId = userId
  7084. c.deviceId = deviceId
  7085. c.installId = installId
  7086. return c
  7087. }
  7088. // Fields allows partial responses to be retrieved. See
  7089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7090. // for more information.
  7091. func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall {
  7092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7093. return c
  7094. }
  7095. // Context sets the context to be used in this call's Do method. Any
  7096. // pending HTTP request will be aborted if the provided context is
  7097. // canceled.
  7098. func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall {
  7099. c.ctx_ = ctx
  7100. return c
  7101. }
  7102. // Header returns an http.Header that can be modified by the caller to
  7103. // add HTTP headers to the request.
  7104. func (c *InstallsDeleteCall) Header() http.Header {
  7105. if c.header_ == nil {
  7106. c.header_ = make(http.Header)
  7107. }
  7108. return c.header_
  7109. }
  7110. func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7111. reqHeaders := make(http.Header)
  7112. for k, v := range c.header_ {
  7113. reqHeaders[k] = v
  7114. }
  7115. reqHeaders.Set("User-Agent", c.s.userAgent())
  7116. var body io.Reader = nil
  7117. c.urlParams_.Set("alt", alt)
  7118. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7119. urls += "?" + c.urlParams_.Encode()
  7120. req, _ := http.NewRequest("DELETE", urls, body)
  7121. req.Header = reqHeaders
  7122. googleapi.Expand(req.URL, map[string]string{
  7123. "enterpriseId": c.enterpriseId,
  7124. "userId": c.userId,
  7125. "deviceId": c.deviceId,
  7126. "installId": c.installId,
  7127. })
  7128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7129. }
  7130. // Do executes the "androidenterprise.installs.delete" call.
  7131. func (c *InstallsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7132. gensupport.SetOptions(c.urlParams_, opts...)
  7133. res, err := c.doRequest("json")
  7134. if err != nil {
  7135. return err
  7136. }
  7137. defer googleapi.CloseBody(res)
  7138. if err := googleapi.CheckResponse(res); err != nil {
  7139. return err
  7140. }
  7141. return nil
  7142. // {
  7143. // "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.",
  7144. // "httpMethod": "DELETE",
  7145. // "id": "androidenterprise.installs.delete",
  7146. // "parameterOrder": [
  7147. // "enterpriseId",
  7148. // "userId",
  7149. // "deviceId",
  7150. // "installId"
  7151. // ],
  7152. // "parameters": {
  7153. // "deviceId": {
  7154. // "description": "The Android ID of the device.",
  7155. // "location": "path",
  7156. // "required": true,
  7157. // "type": "string"
  7158. // },
  7159. // "enterpriseId": {
  7160. // "description": "The ID of the enterprise.",
  7161. // "location": "path",
  7162. // "required": true,
  7163. // "type": "string"
  7164. // },
  7165. // "installId": {
  7166. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7167. // "location": "path",
  7168. // "required": true,
  7169. // "type": "string"
  7170. // },
  7171. // "userId": {
  7172. // "description": "The ID of the user.",
  7173. // "location": "path",
  7174. // "required": true,
  7175. // "type": "string"
  7176. // }
  7177. // },
  7178. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7179. // "scopes": [
  7180. // "https://www.googleapis.com/auth/androidenterprise"
  7181. // ]
  7182. // }
  7183. }
  7184. // method id "androidenterprise.installs.get":
  7185. type InstallsGetCall struct {
  7186. s *Service
  7187. enterpriseId string
  7188. userId string
  7189. deviceId string
  7190. installId string
  7191. urlParams_ gensupport.URLParams
  7192. ifNoneMatch_ string
  7193. ctx_ context.Context
  7194. header_ http.Header
  7195. }
  7196. // Get: Retrieves details of an installation of an app on a device.
  7197. func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall {
  7198. c := &InstallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7199. c.enterpriseId = enterpriseId
  7200. c.userId = userId
  7201. c.deviceId = deviceId
  7202. c.installId = installId
  7203. return c
  7204. }
  7205. // Fields allows partial responses to be retrieved. See
  7206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7207. // for more information.
  7208. func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall {
  7209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7210. return c
  7211. }
  7212. // IfNoneMatch sets the optional parameter which makes the operation
  7213. // fail if the object's ETag matches the given value. This is useful for
  7214. // getting updates only after the object has changed since the last
  7215. // request. Use googleapi.IsNotModified to check whether the response
  7216. // error from Do is the result of In-None-Match.
  7217. func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall {
  7218. c.ifNoneMatch_ = entityTag
  7219. return c
  7220. }
  7221. // Context sets the context to be used in this call's Do method. Any
  7222. // pending HTTP request will be aborted if the provided context is
  7223. // canceled.
  7224. func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall {
  7225. c.ctx_ = ctx
  7226. return c
  7227. }
  7228. // Header returns an http.Header that can be modified by the caller to
  7229. // add HTTP headers to the request.
  7230. func (c *InstallsGetCall) Header() http.Header {
  7231. if c.header_ == nil {
  7232. c.header_ = make(http.Header)
  7233. }
  7234. return c.header_
  7235. }
  7236. func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) {
  7237. reqHeaders := make(http.Header)
  7238. for k, v := range c.header_ {
  7239. reqHeaders[k] = v
  7240. }
  7241. reqHeaders.Set("User-Agent", c.s.userAgent())
  7242. if c.ifNoneMatch_ != "" {
  7243. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7244. }
  7245. var body io.Reader = nil
  7246. c.urlParams_.Set("alt", alt)
  7247. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7248. urls += "?" + c.urlParams_.Encode()
  7249. req, _ := http.NewRequest("GET", urls, body)
  7250. req.Header = reqHeaders
  7251. googleapi.Expand(req.URL, map[string]string{
  7252. "enterpriseId": c.enterpriseId,
  7253. "userId": c.userId,
  7254. "deviceId": c.deviceId,
  7255. "installId": c.installId,
  7256. })
  7257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7258. }
  7259. // Do executes the "androidenterprise.installs.get" call.
  7260. // Exactly one of *Install or error will be non-nil. Any non-2xx status
  7261. // code is an error. Response headers are in either
  7262. // *Install.ServerResponse.Header or (if a response was returned at all)
  7263. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7264. // check whether the returned error was because http.StatusNotModified
  7265. // was returned.
  7266. func (c *InstallsGetCall) Do(opts ...googleapi.CallOption) (*Install, error) {
  7267. gensupport.SetOptions(c.urlParams_, opts...)
  7268. res, err := c.doRequest("json")
  7269. if res != nil && res.StatusCode == http.StatusNotModified {
  7270. if res.Body != nil {
  7271. res.Body.Close()
  7272. }
  7273. return nil, &googleapi.Error{
  7274. Code: res.StatusCode,
  7275. Header: res.Header,
  7276. }
  7277. }
  7278. if err != nil {
  7279. return nil, err
  7280. }
  7281. defer googleapi.CloseBody(res)
  7282. if err := googleapi.CheckResponse(res); err != nil {
  7283. return nil, err
  7284. }
  7285. ret := &Install{
  7286. ServerResponse: googleapi.ServerResponse{
  7287. Header: res.Header,
  7288. HTTPStatusCode: res.StatusCode,
  7289. },
  7290. }
  7291. target := &ret
  7292. if err := gensupport.DecodeResponse(target, res); err != nil {
  7293. return nil, err
  7294. }
  7295. return ret, nil
  7296. // {
  7297. // "description": "Retrieves details of an installation of an app on a device.",
  7298. // "httpMethod": "GET",
  7299. // "id": "androidenterprise.installs.get",
  7300. // "parameterOrder": [
  7301. // "enterpriseId",
  7302. // "userId",
  7303. // "deviceId",
  7304. // "installId"
  7305. // ],
  7306. // "parameters": {
  7307. // "deviceId": {
  7308. // "description": "The Android ID of the device.",
  7309. // "location": "path",
  7310. // "required": true,
  7311. // "type": "string"
  7312. // },
  7313. // "enterpriseId": {
  7314. // "description": "The ID of the enterprise.",
  7315. // "location": "path",
  7316. // "required": true,
  7317. // "type": "string"
  7318. // },
  7319. // "installId": {
  7320. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7321. // "location": "path",
  7322. // "required": true,
  7323. // "type": "string"
  7324. // },
  7325. // "userId": {
  7326. // "description": "The ID of the user.",
  7327. // "location": "path",
  7328. // "required": true,
  7329. // "type": "string"
  7330. // }
  7331. // },
  7332. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7333. // "response": {
  7334. // "$ref": "Install"
  7335. // },
  7336. // "scopes": [
  7337. // "https://www.googleapis.com/auth/androidenterprise"
  7338. // ]
  7339. // }
  7340. }
  7341. // method id "androidenterprise.installs.list":
  7342. type InstallsListCall struct {
  7343. s *Service
  7344. enterpriseId string
  7345. userId string
  7346. deviceId string
  7347. urlParams_ gensupport.URLParams
  7348. ifNoneMatch_ string
  7349. ctx_ context.Context
  7350. header_ http.Header
  7351. }
  7352. // List: Retrieves the details of all apps installed on the specified
  7353. // device.
  7354. func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall {
  7355. c := &InstallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7356. c.enterpriseId = enterpriseId
  7357. c.userId = userId
  7358. c.deviceId = deviceId
  7359. return c
  7360. }
  7361. // Fields allows partial responses to be retrieved. See
  7362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7363. // for more information.
  7364. func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall {
  7365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7366. return c
  7367. }
  7368. // IfNoneMatch sets the optional parameter which makes the operation
  7369. // fail if the object's ETag matches the given value. This is useful for
  7370. // getting updates only after the object has changed since the last
  7371. // request. Use googleapi.IsNotModified to check whether the response
  7372. // error from Do is the result of In-None-Match.
  7373. func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall {
  7374. c.ifNoneMatch_ = entityTag
  7375. return c
  7376. }
  7377. // Context sets the context to be used in this call's Do method. Any
  7378. // pending HTTP request will be aborted if the provided context is
  7379. // canceled.
  7380. func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall {
  7381. c.ctx_ = ctx
  7382. return c
  7383. }
  7384. // Header returns an http.Header that can be modified by the caller to
  7385. // add HTTP headers to the request.
  7386. func (c *InstallsListCall) Header() http.Header {
  7387. if c.header_ == nil {
  7388. c.header_ = make(http.Header)
  7389. }
  7390. return c.header_
  7391. }
  7392. func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) {
  7393. reqHeaders := make(http.Header)
  7394. for k, v := range c.header_ {
  7395. reqHeaders[k] = v
  7396. }
  7397. reqHeaders.Set("User-Agent", c.s.userAgent())
  7398. if c.ifNoneMatch_ != "" {
  7399. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7400. }
  7401. var body io.Reader = nil
  7402. c.urlParams_.Set("alt", alt)
  7403. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs")
  7404. urls += "?" + c.urlParams_.Encode()
  7405. req, _ := http.NewRequest("GET", urls, body)
  7406. req.Header = reqHeaders
  7407. googleapi.Expand(req.URL, map[string]string{
  7408. "enterpriseId": c.enterpriseId,
  7409. "userId": c.userId,
  7410. "deviceId": c.deviceId,
  7411. })
  7412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7413. }
  7414. // Do executes the "androidenterprise.installs.list" call.
  7415. // Exactly one of *InstallsListResponse or error will be non-nil. Any
  7416. // non-2xx status code is an error. Response headers are in either
  7417. // *InstallsListResponse.ServerResponse.Header or (if a response was
  7418. // returned at all) in error.(*googleapi.Error).Header. Use
  7419. // googleapi.IsNotModified to check whether the returned error was
  7420. // because http.StatusNotModified was returned.
  7421. func (c *InstallsListCall) Do(opts ...googleapi.CallOption) (*InstallsListResponse, error) {
  7422. gensupport.SetOptions(c.urlParams_, opts...)
  7423. res, err := c.doRequest("json")
  7424. if res != nil && res.StatusCode == http.StatusNotModified {
  7425. if res.Body != nil {
  7426. res.Body.Close()
  7427. }
  7428. return nil, &googleapi.Error{
  7429. Code: res.StatusCode,
  7430. Header: res.Header,
  7431. }
  7432. }
  7433. if err != nil {
  7434. return nil, err
  7435. }
  7436. defer googleapi.CloseBody(res)
  7437. if err := googleapi.CheckResponse(res); err != nil {
  7438. return nil, err
  7439. }
  7440. ret := &InstallsListResponse{
  7441. ServerResponse: googleapi.ServerResponse{
  7442. Header: res.Header,
  7443. HTTPStatusCode: res.StatusCode,
  7444. },
  7445. }
  7446. target := &ret
  7447. if err := gensupport.DecodeResponse(target, res); err != nil {
  7448. return nil, err
  7449. }
  7450. return ret, nil
  7451. // {
  7452. // "description": "Retrieves the details of all apps installed on the specified device.",
  7453. // "httpMethod": "GET",
  7454. // "id": "androidenterprise.installs.list",
  7455. // "parameterOrder": [
  7456. // "enterpriseId",
  7457. // "userId",
  7458. // "deviceId"
  7459. // ],
  7460. // "parameters": {
  7461. // "deviceId": {
  7462. // "description": "The Android ID of the device.",
  7463. // "location": "path",
  7464. // "required": true,
  7465. // "type": "string"
  7466. // },
  7467. // "enterpriseId": {
  7468. // "description": "The ID of the enterprise.",
  7469. // "location": "path",
  7470. // "required": true,
  7471. // "type": "string"
  7472. // },
  7473. // "userId": {
  7474. // "description": "The ID of the user.",
  7475. // "location": "path",
  7476. // "required": true,
  7477. // "type": "string"
  7478. // }
  7479. // },
  7480. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs",
  7481. // "response": {
  7482. // "$ref": "InstallsListResponse"
  7483. // },
  7484. // "scopes": [
  7485. // "https://www.googleapis.com/auth/androidenterprise"
  7486. // ]
  7487. // }
  7488. }
  7489. // method id "androidenterprise.installs.patch":
  7490. type InstallsPatchCall struct {
  7491. s *Service
  7492. enterpriseId string
  7493. userId string
  7494. deviceId string
  7495. installId string
  7496. install *Install
  7497. urlParams_ gensupport.URLParams
  7498. ctx_ context.Context
  7499. header_ http.Header
  7500. }
  7501. // Patch: Requests to install the latest version of an app to a device.
  7502. // If the app is already installed, then it is updated to the latest
  7503. // version if necessary. This method supports patch semantics.
  7504. func (r *InstallsService) Patch(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsPatchCall {
  7505. c := &InstallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7506. c.enterpriseId = enterpriseId
  7507. c.userId = userId
  7508. c.deviceId = deviceId
  7509. c.installId = installId
  7510. c.install = install
  7511. return c
  7512. }
  7513. // Fields allows partial responses to be retrieved. See
  7514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7515. // for more information.
  7516. func (c *InstallsPatchCall) Fields(s ...googleapi.Field) *InstallsPatchCall {
  7517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7518. return c
  7519. }
  7520. // Context sets the context to be used in this call's Do method. Any
  7521. // pending HTTP request will be aborted if the provided context is
  7522. // canceled.
  7523. func (c *InstallsPatchCall) Context(ctx context.Context) *InstallsPatchCall {
  7524. c.ctx_ = ctx
  7525. return c
  7526. }
  7527. // Header returns an http.Header that can be modified by the caller to
  7528. // add HTTP headers to the request.
  7529. func (c *InstallsPatchCall) Header() http.Header {
  7530. if c.header_ == nil {
  7531. c.header_ = make(http.Header)
  7532. }
  7533. return c.header_
  7534. }
  7535. func (c *InstallsPatchCall) doRequest(alt string) (*http.Response, error) {
  7536. reqHeaders := make(http.Header)
  7537. for k, v := range c.header_ {
  7538. reqHeaders[k] = v
  7539. }
  7540. reqHeaders.Set("User-Agent", c.s.userAgent())
  7541. var body io.Reader = nil
  7542. body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
  7543. if err != nil {
  7544. return nil, err
  7545. }
  7546. reqHeaders.Set("Content-Type", "application/json")
  7547. c.urlParams_.Set("alt", alt)
  7548. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7549. urls += "?" + c.urlParams_.Encode()
  7550. req, _ := http.NewRequest("PATCH", urls, body)
  7551. req.Header = reqHeaders
  7552. googleapi.Expand(req.URL, map[string]string{
  7553. "enterpriseId": c.enterpriseId,
  7554. "userId": c.userId,
  7555. "deviceId": c.deviceId,
  7556. "installId": c.installId,
  7557. })
  7558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7559. }
  7560. // Do executes the "androidenterprise.installs.patch" call.
  7561. // Exactly one of *Install or error will be non-nil. Any non-2xx status
  7562. // code is an error. Response headers are in either
  7563. // *Install.ServerResponse.Header or (if a response was returned at all)
  7564. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7565. // check whether the returned error was because http.StatusNotModified
  7566. // was returned.
  7567. func (c *InstallsPatchCall) Do(opts ...googleapi.CallOption) (*Install, error) {
  7568. gensupport.SetOptions(c.urlParams_, opts...)
  7569. res, err := c.doRequest("json")
  7570. if res != nil && res.StatusCode == http.StatusNotModified {
  7571. if res.Body != nil {
  7572. res.Body.Close()
  7573. }
  7574. return nil, &googleapi.Error{
  7575. Code: res.StatusCode,
  7576. Header: res.Header,
  7577. }
  7578. }
  7579. if err != nil {
  7580. return nil, err
  7581. }
  7582. defer googleapi.CloseBody(res)
  7583. if err := googleapi.CheckResponse(res); err != nil {
  7584. return nil, err
  7585. }
  7586. ret := &Install{
  7587. ServerResponse: googleapi.ServerResponse{
  7588. Header: res.Header,
  7589. HTTPStatusCode: res.StatusCode,
  7590. },
  7591. }
  7592. target := &ret
  7593. if err := gensupport.DecodeResponse(target, res); err != nil {
  7594. return nil, err
  7595. }
  7596. return ret, nil
  7597. // {
  7598. // "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.",
  7599. // "httpMethod": "PATCH",
  7600. // "id": "androidenterprise.installs.patch",
  7601. // "parameterOrder": [
  7602. // "enterpriseId",
  7603. // "userId",
  7604. // "deviceId",
  7605. // "installId"
  7606. // ],
  7607. // "parameters": {
  7608. // "deviceId": {
  7609. // "description": "The Android ID of the device.",
  7610. // "location": "path",
  7611. // "required": true,
  7612. // "type": "string"
  7613. // },
  7614. // "enterpriseId": {
  7615. // "description": "The ID of the enterprise.",
  7616. // "location": "path",
  7617. // "required": true,
  7618. // "type": "string"
  7619. // },
  7620. // "installId": {
  7621. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7622. // "location": "path",
  7623. // "required": true,
  7624. // "type": "string"
  7625. // },
  7626. // "userId": {
  7627. // "description": "The ID of the user.",
  7628. // "location": "path",
  7629. // "required": true,
  7630. // "type": "string"
  7631. // }
  7632. // },
  7633. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7634. // "request": {
  7635. // "$ref": "Install"
  7636. // },
  7637. // "response": {
  7638. // "$ref": "Install"
  7639. // },
  7640. // "scopes": [
  7641. // "https://www.googleapis.com/auth/androidenterprise"
  7642. // ]
  7643. // }
  7644. }
  7645. // method id "androidenterprise.installs.update":
  7646. type InstallsUpdateCall struct {
  7647. s *Service
  7648. enterpriseId string
  7649. userId string
  7650. deviceId string
  7651. installId string
  7652. install *Install
  7653. urlParams_ gensupport.URLParams
  7654. ctx_ context.Context
  7655. header_ http.Header
  7656. }
  7657. // Update: Requests to install the latest version of an app to a device.
  7658. // If the app is already installed, then it is updated to the latest
  7659. // version if necessary.
  7660. func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall {
  7661. c := &InstallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7662. c.enterpriseId = enterpriseId
  7663. c.userId = userId
  7664. c.deviceId = deviceId
  7665. c.installId = installId
  7666. c.install = install
  7667. return c
  7668. }
  7669. // Fields allows partial responses to be retrieved. See
  7670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7671. // for more information.
  7672. func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall {
  7673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7674. return c
  7675. }
  7676. // Context sets the context to be used in this call's Do method. Any
  7677. // pending HTTP request will be aborted if the provided context is
  7678. // canceled.
  7679. func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall {
  7680. c.ctx_ = ctx
  7681. return c
  7682. }
  7683. // Header returns an http.Header that can be modified by the caller to
  7684. // add HTTP headers to the request.
  7685. func (c *InstallsUpdateCall) Header() http.Header {
  7686. if c.header_ == nil {
  7687. c.header_ = make(http.Header)
  7688. }
  7689. return c.header_
  7690. }
  7691. func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7692. reqHeaders := make(http.Header)
  7693. for k, v := range c.header_ {
  7694. reqHeaders[k] = v
  7695. }
  7696. reqHeaders.Set("User-Agent", c.s.userAgent())
  7697. var body io.Reader = nil
  7698. body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
  7699. if err != nil {
  7700. return nil, err
  7701. }
  7702. reqHeaders.Set("Content-Type", "application/json")
  7703. c.urlParams_.Set("alt", alt)
  7704. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
  7705. urls += "?" + c.urlParams_.Encode()
  7706. req, _ := http.NewRequest("PUT", urls, body)
  7707. req.Header = reqHeaders
  7708. googleapi.Expand(req.URL, map[string]string{
  7709. "enterpriseId": c.enterpriseId,
  7710. "userId": c.userId,
  7711. "deviceId": c.deviceId,
  7712. "installId": c.installId,
  7713. })
  7714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7715. }
  7716. // Do executes the "androidenterprise.installs.update" call.
  7717. // Exactly one of *Install or error will be non-nil. Any non-2xx status
  7718. // code is an error. Response headers are in either
  7719. // *Install.ServerResponse.Header or (if a response was returned at all)
  7720. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7721. // check whether the returned error was because http.StatusNotModified
  7722. // was returned.
  7723. func (c *InstallsUpdateCall) Do(opts ...googleapi.CallOption) (*Install, error) {
  7724. gensupport.SetOptions(c.urlParams_, opts...)
  7725. res, err := c.doRequest("json")
  7726. if res != nil && res.StatusCode == http.StatusNotModified {
  7727. if res.Body != nil {
  7728. res.Body.Close()
  7729. }
  7730. return nil, &googleapi.Error{
  7731. Code: res.StatusCode,
  7732. Header: res.Header,
  7733. }
  7734. }
  7735. if err != nil {
  7736. return nil, err
  7737. }
  7738. defer googleapi.CloseBody(res)
  7739. if err := googleapi.CheckResponse(res); err != nil {
  7740. return nil, err
  7741. }
  7742. ret := &Install{
  7743. ServerResponse: googleapi.ServerResponse{
  7744. Header: res.Header,
  7745. HTTPStatusCode: res.StatusCode,
  7746. },
  7747. }
  7748. target := &ret
  7749. if err := gensupport.DecodeResponse(target, res); err != nil {
  7750. return nil, err
  7751. }
  7752. return ret, nil
  7753. // {
  7754. // "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.",
  7755. // "httpMethod": "PUT",
  7756. // "id": "androidenterprise.installs.update",
  7757. // "parameterOrder": [
  7758. // "enterpriseId",
  7759. // "userId",
  7760. // "deviceId",
  7761. // "installId"
  7762. // ],
  7763. // "parameters": {
  7764. // "deviceId": {
  7765. // "description": "The Android ID of the device.",
  7766. // "location": "path",
  7767. // "required": true,
  7768. // "type": "string"
  7769. // },
  7770. // "enterpriseId": {
  7771. // "description": "The ID of the enterprise.",
  7772. // "location": "path",
  7773. // "required": true,
  7774. // "type": "string"
  7775. // },
  7776. // "installId": {
  7777. // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
  7778. // "location": "path",
  7779. // "required": true,
  7780. // "type": "string"
  7781. // },
  7782. // "userId": {
  7783. // "description": "The ID of the user.",
  7784. // "location": "path",
  7785. // "required": true,
  7786. // "type": "string"
  7787. // }
  7788. // },
  7789. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
  7790. // "request": {
  7791. // "$ref": "Install"
  7792. // },
  7793. // "response": {
  7794. // "$ref": "Install"
  7795. // },
  7796. // "scopes": [
  7797. // "https://www.googleapis.com/auth/androidenterprise"
  7798. // ]
  7799. // }
  7800. }
  7801. // method id "androidenterprise.managedconfigurationsfordevice.delete":
  7802. type ManagedconfigurationsfordeviceDeleteCall struct {
  7803. s *Service
  7804. enterpriseId string
  7805. userId string
  7806. deviceId string
  7807. managedConfigurationForDeviceId string
  7808. urlParams_ gensupport.URLParams
  7809. ctx_ context.Context
  7810. header_ http.Header
  7811. }
  7812. // Delete: Removes a per-device managed configuration for an app for the
  7813. // specified device.
  7814. func (r *ManagedconfigurationsfordeviceService) Delete(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceDeleteCall {
  7815. c := &ManagedconfigurationsfordeviceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7816. c.enterpriseId = enterpriseId
  7817. c.userId = userId
  7818. c.deviceId = deviceId
  7819. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  7820. return c
  7821. }
  7822. // Fields allows partial responses to be retrieved. See
  7823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7824. // for more information.
  7825. func (c *ManagedconfigurationsfordeviceDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceDeleteCall {
  7826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7827. return c
  7828. }
  7829. // Context sets the context to be used in this call's Do method. Any
  7830. // pending HTTP request will be aborted if the provided context is
  7831. // canceled.
  7832. func (c *ManagedconfigurationsfordeviceDeleteCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceDeleteCall {
  7833. c.ctx_ = ctx
  7834. return c
  7835. }
  7836. // Header returns an http.Header that can be modified by the caller to
  7837. // add HTTP headers to the request.
  7838. func (c *ManagedconfigurationsfordeviceDeleteCall) Header() http.Header {
  7839. if c.header_ == nil {
  7840. c.header_ = make(http.Header)
  7841. }
  7842. return c.header_
  7843. }
  7844. func (c *ManagedconfigurationsfordeviceDeleteCall) doRequest(alt string) (*http.Response, error) {
  7845. reqHeaders := make(http.Header)
  7846. for k, v := range c.header_ {
  7847. reqHeaders[k] = v
  7848. }
  7849. reqHeaders.Set("User-Agent", c.s.userAgent())
  7850. var body io.Reader = nil
  7851. c.urlParams_.Set("alt", alt)
  7852. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  7853. urls += "?" + c.urlParams_.Encode()
  7854. req, _ := http.NewRequest("DELETE", urls, body)
  7855. req.Header = reqHeaders
  7856. googleapi.Expand(req.URL, map[string]string{
  7857. "enterpriseId": c.enterpriseId,
  7858. "userId": c.userId,
  7859. "deviceId": c.deviceId,
  7860. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  7861. })
  7862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7863. }
  7864. // Do executes the "androidenterprise.managedconfigurationsfordevice.delete" call.
  7865. func (c *ManagedconfigurationsfordeviceDeleteCall) Do(opts ...googleapi.CallOption) error {
  7866. gensupport.SetOptions(c.urlParams_, opts...)
  7867. res, err := c.doRequest("json")
  7868. if err != nil {
  7869. return err
  7870. }
  7871. defer googleapi.CloseBody(res)
  7872. if err := googleapi.CheckResponse(res); err != nil {
  7873. return err
  7874. }
  7875. return nil
  7876. // {
  7877. // "description": "Removes a per-device managed configuration for an app for the specified device.",
  7878. // "httpMethod": "DELETE",
  7879. // "id": "androidenterprise.managedconfigurationsfordevice.delete",
  7880. // "parameterOrder": [
  7881. // "enterpriseId",
  7882. // "userId",
  7883. // "deviceId",
  7884. // "managedConfigurationForDeviceId"
  7885. // ],
  7886. // "parameters": {
  7887. // "deviceId": {
  7888. // "description": "The Android ID of the device.",
  7889. // "location": "path",
  7890. // "required": true,
  7891. // "type": "string"
  7892. // },
  7893. // "enterpriseId": {
  7894. // "description": "The ID of the enterprise.",
  7895. // "location": "path",
  7896. // "required": true,
  7897. // "type": "string"
  7898. // },
  7899. // "managedConfigurationForDeviceId": {
  7900. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  7901. // "location": "path",
  7902. // "required": true,
  7903. // "type": "string"
  7904. // },
  7905. // "userId": {
  7906. // "description": "The ID of the user.",
  7907. // "location": "path",
  7908. // "required": true,
  7909. // "type": "string"
  7910. // }
  7911. // },
  7912. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  7913. // "scopes": [
  7914. // "https://www.googleapis.com/auth/androidenterprise"
  7915. // ]
  7916. // }
  7917. }
  7918. // method id "androidenterprise.managedconfigurationsfordevice.get":
  7919. type ManagedconfigurationsfordeviceGetCall struct {
  7920. s *Service
  7921. enterpriseId string
  7922. userId string
  7923. deviceId string
  7924. managedConfigurationForDeviceId string
  7925. urlParams_ gensupport.URLParams
  7926. ifNoneMatch_ string
  7927. ctx_ context.Context
  7928. header_ http.Header
  7929. }
  7930. // Get: Retrieves details of a per-device managed configuration.
  7931. func (r *ManagedconfigurationsfordeviceService) Get(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string) *ManagedconfigurationsfordeviceGetCall {
  7932. c := &ManagedconfigurationsfordeviceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7933. c.enterpriseId = enterpriseId
  7934. c.userId = userId
  7935. c.deviceId = deviceId
  7936. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  7937. return c
  7938. }
  7939. // Fields allows partial responses to be retrieved. See
  7940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7941. // for more information.
  7942. func (c *ManagedconfigurationsfordeviceGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceGetCall {
  7943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7944. return c
  7945. }
  7946. // IfNoneMatch sets the optional parameter which makes the operation
  7947. // fail if the object's ETag matches the given value. This is useful for
  7948. // getting updates only after the object has changed since the last
  7949. // request. Use googleapi.IsNotModified to check whether the response
  7950. // error from Do is the result of In-None-Match.
  7951. func (c *ManagedconfigurationsfordeviceGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceGetCall {
  7952. c.ifNoneMatch_ = entityTag
  7953. return c
  7954. }
  7955. // Context sets the context to be used in this call's Do method. Any
  7956. // pending HTTP request will be aborted if the provided context is
  7957. // canceled.
  7958. func (c *ManagedconfigurationsfordeviceGetCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceGetCall {
  7959. c.ctx_ = ctx
  7960. return c
  7961. }
  7962. // Header returns an http.Header that can be modified by the caller to
  7963. // add HTTP headers to the request.
  7964. func (c *ManagedconfigurationsfordeviceGetCall) Header() http.Header {
  7965. if c.header_ == nil {
  7966. c.header_ = make(http.Header)
  7967. }
  7968. return c.header_
  7969. }
  7970. func (c *ManagedconfigurationsfordeviceGetCall) doRequest(alt string) (*http.Response, error) {
  7971. reqHeaders := make(http.Header)
  7972. for k, v := range c.header_ {
  7973. reqHeaders[k] = v
  7974. }
  7975. reqHeaders.Set("User-Agent", c.s.userAgent())
  7976. if c.ifNoneMatch_ != "" {
  7977. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7978. }
  7979. var body io.Reader = nil
  7980. c.urlParams_.Set("alt", alt)
  7981. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  7982. urls += "?" + c.urlParams_.Encode()
  7983. req, _ := http.NewRequest("GET", urls, body)
  7984. req.Header = reqHeaders
  7985. googleapi.Expand(req.URL, map[string]string{
  7986. "enterpriseId": c.enterpriseId,
  7987. "userId": c.userId,
  7988. "deviceId": c.deviceId,
  7989. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  7990. })
  7991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7992. }
  7993. // Do executes the "androidenterprise.managedconfigurationsfordevice.get" call.
  7994. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  7995. // non-2xx status code is an error. Response headers are in either
  7996. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  7997. // returned at all) in error.(*googleapi.Error).Header. Use
  7998. // googleapi.IsNotModified to check whether the returned error was
  7999. // because http.StatusNotModified was returned.
  8000. func (c *ManagedconfigurationsfordeviceGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8001. gensupport.SetOptions(c.urlParams_, opts...)
  8002. res, err := c.doRequest("json")
  8003. if res != nil && res.StatusCode == http.StatusNotModified {
  8004. if res.Body != nil {
  8005. res.Body.Close()
  8006. }
  8007. return nil, &googleapi.Error{
  8008. Code: res.StatusCode,
  8009. Header: res.Header,
  8010. }
  8011. }
  8012. if err != nil {
  8013. return nil, err
  8014. }
  8015. defer googleapi.CloseBody(res)
  8016. if err := googleapi.CheckResponse(res); err != nil {
  8017. return nil, err
  8018. }
  8019. ret := &ManagedConfiguration{
  8020. ServerResponse: googleapi.ServerResponse{
  8021. Header: res.Header,
  8022. HTTPStatusCode: res.StatusCode,
  8023. },
  8024. }
  8025. target := &ret
  8026. if err := gensupport.DecodeResponse(target, res); err != nil {
  8027. return nil, err
  8028. }
  8029. return ret, nil
  8030. // {
  8031. // "description": "Retrieves details of a per-device managed configuration.",
  8032. // "httpMethod": "GET",
  8033. // "id": "androidenterprise.managedconfigurationsfordevice.get",
  8034. // "parameterOrder": [
  8035. // "enterpriseId",
  8036. // "userId",
  8037. // "deviceId",
  8038. // "managedConfigurationForDeviceId"
  8039. // ],
  8040. // "parameters": {
  8041. // "deviceId": {
  8042. // "description": "The Android ID of the device.",
  8043. // "location": "path",
  8044. // "required": true,
  8045. // "type": "string"
  8046. // },
  8047. // "enterpriseId": {
  8048. // "description": "The ID of the enterprise.",
  8049. // "location": "path",
  8050. // "required": true,
  8051. // "type": "string"
  8052. // },
  8053. // "managedConfigurationForDeviceId": {
  8054. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8055. // "location": "path",
  8056. // "required": true,
  8057. // "type": "string"
  8058. // },
  8059. // "userId": {
  8060. // "description": "The ID of the user.",
  8061. // "location": "path",
  8062. // "required": true,
  8063. // "type": "string"
  8064. // }
  8065. // },
  8066. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8067. // "response": {
  8068. // "$ref": "ManagedConfiguration"
  8069. // },
  8070. // "scopes": [
  8071. // "https://www.googleapis.com/auth/androidenterprise"
  8072. // ]
  8073. // }
  8074. }
  8075. // method id "androidenterprise.managedconfigurationsfordevice.list":
  8076. type ManagedconfigurationsfordeviceListCall struct {
  8077. s *Service
  8078. enterpriseId string
  8079. userId string
  8080. deviceId string
  8081. urlParams_ gensupport.URLParams
  8082. ifNoneMatch_ string
  8083. ctx_ context.Context
  8084. header_ http.Header
  8085. }
  8086. // List: Lists all the per-device managed configurations for the
  8087. // specified device. Only the ID is set.
  8088. func (r *ManagedconfigurationsfordeviceService) List(enterpriseId string, userId string, deviceId string) *ManagedconfigurationsfordeviceListCall {
  8089. c := &ManagedconfigurationsfordeviceListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8090. c.enterpriseId = enterpriseId
  8091. c.userId = userId
  8092. c.deviceId = deviceId
  8093. return c
  8094. }
  8095. // Fields allows partial responses to be retrieved. See
  8096. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8097. // for more information.
  8098. func (c *ManagedconfigurationsfordeviceListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceListCall {
  8099. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8100. return c
  8101. }
  8102. // IfNoneMatch sets the optional parameter which makes the operation
  8103. // fail if the object's ETag matches the given value. This is useful for
  8104. // getting updates only after the object has changed since the last
  8105. // request. Use googleapi.IsNotModified to check whether the response
  8106. // error from Do is the result of In-None-Match.
  8107. func (c *ManagedconfigurationsfordeviceListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsfordeviceListCall {
  8108. c.ifNoneMatch_ = entityTag
  8109. return c
  8110. }
  8111. // Context sets the context to be used in this call's Do method. Any
  8112. // pending HTTP request will be aborted if the provided context is
  8113. // canceled.
  8114. func (c *ManagedconfigurationsfordeviceListCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceListCall {
  8115. c.ctx_ = ctx
  8116. return c
  8117. }
  8118. // Header returns an http.Header that can be modified by the caller to
  8119. // add HTTP headers to the request.
  8120. func (c *ManagedconfigurationsfordeviceListCall) Header() http.Header {
  8121. if c.header_ == nil {
  8122. c.header_ = make(http.Header)
  8123. }
  8124. return c.header_
  8125. }
  8126. func (c *ManagedconfigurationsfordeviceListCall) doRequest(alt string) (*http.Response, error) {
  8127. reqHeaders := make(http.Header)
  8128. for k, v := range c.header_ {
  8129. reqHeaders[k] = v
  8130. }
  8131. reqHeaders.Set("User-Agent", c.s.userAgent())
  8132. if c.ifNoneMatch_ != "" {
  8133. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8134. }
  8135. var body io.Reader = nil
  8136. c.urlParams_.Set("alt", alt)
  8137. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice")
  8138. urls += "?" + c.urlParams_.Encode()
  8139. req, _ := http.NewRequest("GET", urls, body)
  8140. req.Header = reqHeaders
  8141. googleapi.Expand(req.URL, map[string]string{
  8142. "enterpriseId": c.enterpriseId,
  8143. "userId": c.userId,
  8144. "deviceId": c.deviceId,
  8145. })
  8146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8147. }
  8148. // Do executes the "androidenterprise.managedconfigurationsfordevice.list" call.
  8149. // Exactly one of *ManagedConfigurationsForDeviceListResponse or error
  8150. // will be non-nil. Any non-2xx status code is an error. Response
  8151. // headers are in either
  8152. // *ManagedConfigurationsForDeviceListResponse.ServerResponse.Header or
  8153. // (if a response was returned at all) in
  8154. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8155. // whether the returned error was because http.StatusNotModified was
  8156. // returned.
  8157. func (c *ManagedconfigurationsfordeviceListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForDeviceListResponse, error) {
  8158. gensupport.SetOptions(c.urlParams_, opts...)
  8159. res, err := c.doRequest("json")
  8160. if res != nil && res.StatusCode == http.StatusNotModified {
  8161. if res.Body != nil {
  8162. res.Body.Close()
  8163. }
  8164. return nil, &googleapi.Error{
  8165. Code: res.StatusCode,
  8166. Header: res.Header,
  8167. }
  8168. }
  8169. if err != nil {
  8170. return nil, err
  8171. }
  8172. defer googleapi.CloseBody(res)
  8173. if err := googleapi.CheckResponse(res); err != nil {
  8174. return nil, err
  8175. }
  8176. ret := &ManagedConfigurationsForDeviceListResponse{
  8177. ServerResponse: googleapi.ServerResponse{
  8178. Header: res.Header,
  8179. HTTPStatusCode: res.StatusCode,
  8180. },
  8181. }
  8182. target := &ret
  8183. if err := gensupport.DecodeResponse(target, res); err != nil {
  8184. return nil, err
  8185. }
  8186. return ret, nil
  8187. // {
  8188. // "description": "Lists all the per-device managed configurations for the specified device. Only the ID is set.",
  8189. // "httpMethod": "GET",
  8190. // "id": "androidenterprise.managedconfigurationsfordevice.list",
  8191. // "parameterOrder": [
  8192. // "enterpriseId",
  8193. // "userId",
  8194. // "deviceId"
  8195. // ],
  8196. // "parameters": {
  8197. // "deviceId": {
  8198. // "description": "The Android ID of the device.",
  8199. // "location": "path",
  8200. // "required": true,
  8201. // "type": "string"
  8202. // },
  8203. // "enterpriseId": {
  8204. // "description": "The ID of the enterprise.",
  8205. // "location": "path",
  8206. // "required": true,
  8207. // "type": "string"
  8208. // },
  8209. // "userId": {
  8210. // "description": "The ID of the user.",
  8211. // "location": "path",
  8212. // "required": true,
  8213. // "type": "string"
  8214. // }
  8215. // },
  8216. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice",
  8217. // "response": {
  8218. // "$ref": "ManagedConfigurationsForDeviceListResponse"
  8219. // },
  8220. // "scopes": [
  8221. // "https://www.googleapis.com/auth/androidenterprise"
  8222. // ]
  8223. // }
  8224. }
  8225. // method id "androidenterprise.managedconfigurationsfordevice.patch":
  8226. type ManagedconfigurationsfordevicePatchCall struct {
  8227. s *Service
  8228. enterpriseId string
  8229. userId string
  8230. deviceId string
  8231. managedConfigurationForDeviceId string
  8232. managedconfiguration *ManagedConfiguration
  8233. urlParams_ gensupport.URLParams
  8234. ctx_ context.Context
  8235. header_ http.Header
  8236. }
  8237. // Patch: Adds or updates a per-device managed configuration for an app
  8238. // for the specified device. This method supports patch semantics.
  8239. func (r *ManagedconfigurationsfordeviceService) Patch(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordevicePatchCall {
  8240. c := &ManagedconfigurationsfordevicePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8241. c.enterpriseId = enterpriseId
  8242. c.userId = userId
  8243. c.deviceId = deviceId
  8244. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  8245. c.managedconfiguration = managedconfiguration
  8246. return c
  8247. }
  8248. // Fields allows partial responses to be retrieved. See
  8249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8250. // for more information.
  8251. func (c *ManagedconfigurationsfordevicePatchCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordevicePatchCall {
  8252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8253. return c
  8254. }
  8255. // Context sets the context to be used in this call's Do method. Any
  8256. // pending HTTP request will be aborted if the provided context is
  8257. // canceled.
  8258. func (c *ManagedconfigurationsfordevicePatchCall) Context(ctx context.Context) *ManagedconfigurationsfordevicePatchCall {
  8259. c.ctx_ = ctx
  8260. return c
  8261. }
  8262. // Header returns an http.Header that can be modified by the caller to
  8263. // add HTTP headers to the request.
  8264. func (c *ManagedconfigurationsfordevicePatchCall) Header() http.Header {
  8265. if c.header_ == nil {
  8266. c.header_ = make(http.Header)
  8267. }
  8268. return c.header_
  8269. }
  8270. func (c *ManagedconfigurationsfordevicePatchCall) doRequest(alt string) (*http.Response, error) {
  8271. reqHeaders := make(http.Header)
  8272. for k, v := range c.header_ {
  8273. reqHeaders[k] = v
  8274. }
  8275. reqHeaders.Set("User-Agent", c.s.userAgent())
  8276. var body io.Reader = nil
  8277. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  8278. if err != nil {
  8279. return nil, err
  8280. }
  8281. reqHeaders.Set("Content-Type", "application/json")
  8282. c.urlParams_.Set("alt", alt)
  8283. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  8284. urls += "?" + c.urlParams_.Encode()
  8285. req, _ := http.NewRequest("PATCH", urls, body)
  8286. req.Header = reqHeaders
  8287. googleapi.Expand(req.URL, map[string]string{
  8288. "enterpriseId": c.enterpriseId,
  8289. "userId": c.userId,
  8290. "deviceId": c.deviceId,
  8291. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  8292. })
  8293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8294. }
  8295. // Do executes the "androidenterprise.managedconfigurationsfordevice.patch" call.
  8296. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8297. // non-2xx status code is an error. Response headers are in either
  8298. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8299. // returned at all) in error.(*googleapi.Error).Header. Use
  8300. // googleapi.IsNotModified to check whether the returned error was
  8301. // because http.StatusNotModified was returned.
  8302. func (c *ManagedconfigurationsfordevicePatchCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8303. gensupport.SetOptions(c.urlParams_, opts...)
  8304. res, err := c.doRequest("json")
  8305. if res != nil && res.StatusCode == http.StatusNotModified {
  8306. if res.Body != nil {
  8307. res.Body.Close()
  8308. }
  8309. return nil, &googleapi.Error{
  8310. Code: res.StatusCode,
  8311. Header: res.Header,
  8312. }
  8313. }
  8314. if err != nil {
  8315. return nil, err
  8316. }
  8317. defer googleapi.CloseBody(res)
  8318. if err := googleapi.CheckResponse(res); err != nil {
  8319. return nil, err
  8320. }
  8321. ret := &ManagedConfiguration{
  8322. ServerResponse: googleapi.ServerResponse{
  8323. Header: res.Header,
  8324. HTTPStatusCode: res.StatusCode,
  8325. },
  8326. }
  8327. target := &ret
  8328. if err := gensupport.DecodeResponse(target, res); err != nil {
  8329. return nil, err
  8330. }
  8331. return ret, nil
  8332. // {
  8333. // "description": "Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics.",
  8334. // "httpMethod": "PATCH",
  8335. // "id": "androidenterprise.managedconfigurationsfordevice.patch",
  8336. // "parameterOrder": [
  8337. // "enterpriseId",
  8338. // "userId",
  8339. // "deviceId",
  8340. // "managedConfigurationForDeviceId"
  8341. // ],
  8342. // "parameters": {
  8343. // "deviceId": {
  8344. // "description": "The Android ID of the device.",
  8345. // "location": "path",
  8346. // "required": true,
  8347. // "type": "string"
  8348. // },
  8349. // "enterpriseId": {
  8350. // "description": "The ID of the enterprise.",
  8351. // "location": "path",
  8352. // "required": true,
  8353. // "type": "string"
  8354. // },
  8355. // "managedConfigurationForDeviceId": {
  8356. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8357. // "location": "path",
  8358. // "required": true,
  8359. // "type": "string"
  8360. // },
  8361. // "userId": {
  8362. // "description": "The ID of the user.",
  8363. // "location": "path",
  8364. // "required": true,
  8365. // "type": "string"
  8366. // }
  8367. // },
  8368. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8369. // "request": {
  8370. // "$ref": "ManagedConfiguration"
  8371. // },
  8372. // "response": {
  8373. // "$ref": "ManagedConfiguration"
  8374. // },
  8375. // "scopes": [
  8376. // "https://www.googleapis.com/auth/androidenterprise"
  8377. // ]
  8378. // }
  8379. }
  8380. // method id "androidenterprise.managedconfigurationsfordevice.update":
  8381. type ManagedconfigurationsfordeviceUpdateCall struct {
  8382. s *Service
  8383. enterpriseId string
  8384. userId string
  8385. deviceId string
  8386. managedConfigurationForDeviceId string
  8387. managedconfiguration *ManagedConfiguration
  8388. urlParams_ gensupport.URLParams
  8389. ctx_ context.Context
  8390. header_ http.Header
  8391. }
  8392. // Update: Adds or updates a per-device managed configuration for an app
  8393. // for the specified device.
  8394. func (r *ManagedconfigurationsfordeviceService) Update(enterpriseId string, userId string, deviceId string, managedConfigurationForDeviceId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsfordeviceUpdateCall {
  8395. c := &ManagedconfigurationsfordeviceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8396. c.enterpriseId = enterpriseId
  8397. c.userId = userId
  8398. c.deviceId = deviceId
  8399. c.managedConfigurationForDeviceId = managedConfigurationForDeviceId
  8400. c.managedconfiguration = managedconfiguration
  8401. return c
  8402. }
  8403. // Fields allows partial responses to be retrieved. See
  8404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8405. // for more information.
  8406. func (c *ManagedconfigurationsfordeviceUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsfordeviceUpdateCall {
  8407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8408. return c
  8409. }
  8410. // Context sets the context to be used in this call's Do method. Any
  8411. // pending HTTP request will be aborted if the provided context is
  8412. // canceled.
  8413. func (c *ManagedconfigurationsfordeviceUpdateCall) Context(ctx context.Context) *ManagedconfigurationsfordeviceUpdateCall {
  8414. c.ctx_ = ctx
  8415. return c
  8416. }
  8417. // Header returns an http.Header that can be modified by the caller to
  8418. // add HTTP headers to the request.
  8419. func (c *ManagedconfigurationsfordeviceUpdateCall) Header() http.Header {
  8420. if c.header_ == nil {
  8421. c.header_ = make(http.Header)
  8422. }
  8423. return c.header_
  8424. }
  8425. func (c *ManagedconfigurationsfordeviceUpdateCall) doRequest(alt string) (*http.Response, error) {
  8426. reqHeaders := make(http.Header)
  8427. for k, v := range c.header_ {
  8428. reqHeaders[k] = v
  8429. }
  8430. reqHeaders.Set("User-Agent", c.s.userAgent())
  8431. var body io.Reader = nil
  8432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  8433. if err != nil {
  8434. return nil, err
  8435. }
  8436. reqHeaders.Set("Content-Type", "application/json")
  8437. c.urlParams_.Set("alt", alt)
  8438. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}")
  8439. urls += "?" + c.urlParams_.Encode()
  8440. req, _ := http.NewRequest("PUT", urls, body)
  8441. req.Header = reqHeaders
  8442. googleapi.Expand(req.URL, map[string]string{
  8443. "enterpriseId": c.enterpriseId,
  8444. "userId": c.userId,
  8445. "deviceId": c.deviceId,
  8446. "managedConfigurationForDeviceId": c.managedConfigurationForDeviceId,
  8447. })
  8448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8449. }
  8450. // Do executes the "androidenterprise.managedconfigurationsfordevice.update" call.
  8451. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8452. // non-2xx status code is an error. Response headers are in either
  8453. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8454. // returned at all) in error.(*googleapi.Error).Header. Use
  8455. // googleapi.IsNotModified to check whether the returned error was
  8456. // because http.StatusNotModified was returned.
  8457. func (c *ManagedconfigurationsfordeviceUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8458. gensupport.SetOptions(c.urlParams_, opts...)
  8459. res, err := c.doRequest("json")
  8460. if res != nil && res.StatusCode == http.StatusNotModified {
  8461. if res.Body != nil {
  8462. res.Body.Close()
  8463. }
  8464. return nil, &googleapi.Error{
  8465. Code: res.StatusCode,
  8466. Header: res.Header,
  8467. }
  8468. }
  8469. if err != nil {
  8470. return nil, err
  8471. }
  8472. defer googleapi.CloseBody(res)
  8473. if err := googleapi.CheckResponse(res); err != nil {
  8474. return nil, err
  8475. }
  8476. ret := &ManagedConfiguration{
  8477. ServerResponse: googleapi.ServerResponse{
  8478. Header: res.Header,
  8479. HTTPStatusCode: res.StatusCode,
  8480. },
  8481. }
  8482. target := &ret
  8483. if err := gensupport.DecodeResponse(target, res); err != nil {
  8484. return nil, err
  8485. }
  8486. return ret, nil
  8487. // {
  8488. // "description": "Adds or updates a per-device managed configuration for an app for the specified device.",
  8489. // "httpMethod": "PUT",
  8490. // "id": "androidenterprise.managedconfigurationsfordevice.update",
  8491. // "parameterOrder": [
  8492. // "enterpriseId",
  8493. // "userId",
  8494. // "deviceId",
  8495. // "managedConfigurationForDeviceId"
  8496. // ],
  8497. // "parameters": {
  8498. // "deviceId": {
  8499. // "description": "The Android ID of the device.",
  8500. // "location": "path",
  8501. // "required": true,
  8502. // "type": "string"
  8503. // },
  8504. // "enterpriseId": {
  8505. // "description": "The ID of the enterprise.",
  8506. // "location": "path",
  8507. // "required": true,
  8508. // "type": "string"
  8509. // },
  8510. // "managedConfigurationForDeviceId": {
  8511. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8512. // "location": "path",
  8513. // "required": true,
  8514. // "type": "string"
  8515. // },
  8516. // "userId": {
  8517. // "description": "The ID of the user.",
  8518. // "location": "path",
  8519. // "required": true,
  8520. // "type": "string"
  8521. // }
  8522. // },
  8523. // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}",
  8524. // "request": {
  8525. // "$ref": "ManagedConfiguration"
  8526. // },
  8527. // "response": {
  8528. // "$ref": "ManagedConfiguration"
  8529. // },
  8530. // "scopes": [
  8531. // "https://www.googleapis.com/auth/androidenterprise"
  8532. // ]
  8533. // }
  8534. }
  8535. // method id "androidenterprise.managedconfigurationsforuser.delete":
  8536. type ManagedconfigurationsforuserDeleteCall struct {
  8537. s *Service
  8538. enterpriseId string
  8539. userId string
  8540. managedConfigurationForUserId string
  8541. urlParams_ gensupport.URLParams
  8542. ctx_ context.Context
  8543. header_ http.Header
  8544. }
  8545. // Delete: Removes a per-user managed configuration for an app for the
  8546. // specified user.
  8547. func (r *ManagedconfigurationsforuserService) Delete(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserDeleteCall {
  8548. c := &ManagedconfigurationsforuserDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8549. c.enterpriseId = enterpriseId
  8550. c.userId = userId
  8551. c.managedConfigurationForUserId = managedConfigurationForUserId
  8552. return c
  8553. }
  8554. // Fields allows partial responses to be retrieved. See
  8555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8556. // for more information.
  8557. func (c *ManagedconfigurationsforuserDeleteCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserDeleteCall {
  8558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8559. return c
  8560. }
  8561. // Context sets the context to be used in this call's Do method. Any
  8562. // pending HTTP request will be aborted if the provided context is
  8563. // canceled.
  8564. func (c *ManagedconfigurationsforuserDeleteCall) Context(ctx context.Context) *ManagedconfigurationsforuserDeleteCall {
  8565. c.ctx_ = ctx
  8566. return c
  8567. }
  8568. // Header returns an http.Header that can be modified by the caller to
  8569. // add HTTP headers to the request.
  8570. func (c *ManagedconfigurationsforuserDeleteCall) Header() http.Header {
  8571. if c.header_ == nil {
  8572. c.header_ = make(http.Header)
  8573. }
  8574. return c.header_
  8575. }
  8576. func (c *ManagedconfigurationsforuserDeleteCall) doRequest(alt string) (*http.Response, error) {
  8577. reqHeaders := make(http.Header)
  8578. for k, v := range c.header_ {
  8579. reqHeaders[k] = v
  8580. }
  8581. reqHeaders.Set("User-Agent", c.s.userAgent())
  8582. var body io.Reader = nil
  8583. c.urlParams_.Set("alt", alt)
  8584. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  8585. urls += "?" + c.urlParams_.Encode()
  8586. req, _ := http.NewRequest("DELETE", urls, body)
  8587. req.Header = reqHeaders
  8588. googleapi.Expand(req.URL, map[string]string{
  8589. "enterpriseId": c.enterpriseId,
  8590. "userId": c.userId,
  8591. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  8592. })
  8593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8594. }
  8595. // Do executes the "androidenterprise.managedconfigurationsforuser.delete" call.
  8596. func (c *ManagedconfigurationsforuserDeleteCall) Do(opts ...googleapi.CallOption) error {
  8597. gensupport.SetOptions(c.urlParams_, opts...)
  8598. res, err := c.doRequest("json")
  8599. if err != nil {
  8600. return err
  8601. }
  8602. defer googleapi.CloseBody(res)
  8603. if err := googleapi.CheckResponse(res); err != nil {
  8604. return err
  8605. }
  8606. return nil
  8607. // {
  8608. // "description": "Removes a per-user managed configuration for an app for the specified user.",
  8609. // "httpMethod": "DELETE",
  8610. // "id": "androidenterprise.managedconfigurationsforuser.delete",
  8611. // "parameterOrder": [
  8612. // "enterpriseId",
  8613. // "userId",
  8614. // "managedConfigurationForUserId"
  8615. // ],
  8616. // "parameters": {
  8617. // "enterpriseId": {
  8618. // "description": "The ID of the enterprise.",
  8619. // "location": "path",
  8620. // "required": true,
  8621. // "type": "string"
  8622. // },
  8623. // "managedConfigurationForUserId": {
  8624. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8625. // "location": "path",
  8626. // "required": true,
  8627. // "type": "string"
  8628. // },
  8629. // "userId": {
  8630. // "description": "The ID of the user.",
  8631. // "location": "path",
  8632. // "required": true,
  8633. // "type": "string"
  8634. // }
  8635. // },
  8636. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  8637. // "scopes": [
  8638. // "https://www.googleapis.com/auth/androidenterprise"
  8639. // ]
  8640. // }
  8641. }
  8642. // method id "androidenterprise.managedconfigurationsforuser.get":
  8643. type ManagedconfigurationsforuserGetCall struct {
  8644. s *Service
  8645. enterpriseId string
  8646. userId string
  8647. managedConfigurationForUserId string
  8648. urlParams_ gensupport.URLParams
  8649. ifNoneMatch_ string
  8650. ctx_ context.Context
  8651. header_ http.Header
  8652. }
  8653. // Get: Retrieves details of a per-user managed configuration for an app
  8654. // for the specified user.
  8655. func (r *ManagedconfigurationsforuserService) Get(enterpriseId string, userId string, managedConfigurationForUserId string) *ManagedconfigurationsforuserGetCall {
  8656. c := &ManagedconfigurationsforuserGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8657. c.enterpriseId = enterpriseId
  8658. c.userId = userId
  8659. c.managedConfigurationForUserId = managedConfigurationForUserId
  8660. return c
  8661. }
  8662. // Fields allows partial responses to be retrieved. See
  8663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8664. // for more information.
  8665. func (c *ManagedconfigurationsforuserGetCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserGetCall {
  8666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8667. return c
  8668. }
  8669. // IfNoneMatch sets the optional parameter which makes the operation
  8670. // fail if the object's ETag matches the given value. This is useful for
  8671. // getting updates only after the object has changed since the last
  8672. // request. Use googleapi.IsNotModified to check whether the response
  8673. // error from Do is the result of In-None-Match.
  8674. func (c *ManagedconfigurationsforuserGetCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserGetCall {
  8675. c.ifNoneMatch_ = entityTag
  8676. return c
  8677. }
  8678. // Context sets the context to be used in this call's Do method. Any
  8679. // pending HTTP request will be aborted if the provided context is
  8680. // canceled.
  8681. func (c *ManagedconfigurationsforuserGetCall) Context(ctx context.Context) *ManagedconfigurationsforuserGetCall {
  8682. c.ctx_ = ctx
  8683. return c
  8684. }
  8685. // Header returns an http.Header that can be modified by the caller to
  8686. // add HTTP headers to the request.
  8687. func (c *ManagedconfigurationsforuserGetCall) Header() http.Header {
  8688. if c.header_ == nil {
  8689. c.header_ = make(http.Header)
  8690. }
  8691. return c.header_
  8692. }
  8693. func (c *ManagedconfigurationsforuserGetCall) doRequest(alt string) (*http.Response, error) {
  8694. reqHeaders := make(http.Header)
  8695. for k, v := range c.header_ {
  8696. reqHeaders[k] = v
  8697. }
  8698. reqHeaders.Set("User-Agent", c.s.userAgent())
  8699. if c.ifNoneMatch_ != "" {
  8700. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8701. }
  8702. var body io.Reader = nil
  8703. c.urlParams_.Set("alt", alt)
  8704. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  8705. urls += "?" + c.urlParams_.Encode()
  8706. req, _ := http.NewRequest("GET", urls, body)
  8707. req.Header = reqHeaders
  8708. googleapi.Expand(req.URL, map[string]string{
  8709. "enterpriseId": c.enterpriseId,
  8710. "userId": c.userId,
  8711. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  8712. })
  8713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8714. }
  8715. // Do executes the "androidenterprise.managedconfigurationsforuser.get" call.
  8716. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  8717. // non-2xx status code is an error. Response headers are in either
  8718. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  8719. // returned at all) in error.(*googleapi.Error).Header. Use
  8720. // googleapi.IsNotModified to check whether the returned error was
  8721. // because http.StatusNotModified was returned.
  8722. func (c *ManagedconfigurationsforuserGetCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  8723. gensupport.SetOptions(c.urlParams_, opts...)
  8724. res, err := c.doRequest("json")
  8725. if res != nil && res.StatusCode == http.StatusNotModified {
  8726. if res.Body != nil {
  8727. res.Body.Close()
  8728. }
  8729. return nil, &googleapi.Error{
  8730. Code: res.StatusCode,
  8731. Header: res.Header,
  8732. }
  8733. }
  8734. if err != nil {
  8735. return nil, err
  8736. }
  8737. defer googleapi.CloseBody(res)
  8738. if err := googleapi.CheckResponse(res); err != nil {
  8739. return nil, err
  8740. }
  8741. ret := &ManagedConfiguration{
  8742. ServerResponse: googleapi.ServerResponse{
  8743. Header: res.Header,
  8744. HTTPStatusCode: res.StatusCode,
  8745. },
  8746. }
  8747. target := &ret
  8748. if err := gensupport.DecodeResponse(target, res); err != nil {
  8749. return nil, err
  8750. }
  8751. return ret, nil
  8752. // {
  8753. // "description": "Retrieves details of a per-user managed configuration for an app for the specified user.",
  8754. // "httpMethod": "GET",
  8755. // "id": "androidenterprise.managedconfigurationsforuser.get",
  8756. // "parameterOrder": [
  8757. // "enterpriseId",
  8758. // "userId",
  8759. // "managedConfigurationForUserId"
  8760. // ],
  8761. // "parameters": {
  8762. // "enterpriseId": {
  8763. // "description": "The ID of the enterprise.",
  8764. // "location": "path",
  8765. // "required": true,
  8766. // "type": "string"
  8767. // },
  8768. // "managedConfigurationForUserId": {
  8769. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  8770. // "location": "path",
  8771. // "required": true,
  8772. // "type": "string"
  8773. // },
  8774. // "userId": {
  8775. // "description": "The ID of the user.",
  8776. // "location": "path",
  8777. // "required": true,
  8778. // "type": "string"
  8779. // }
  8780. // },
  8781. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  8782. // "response": {
  8783. // "$ref": "ManagedConfiguration"
  8784. // },
  8785. // "scopes": [
  8786. // "https://www.googleapis.com/auth/androidenterprise"
  8787. // ]
  8788. // }
  8789. }
  8790. // method id "androidenterprise.managedconfigurationsforuser.list":
  8791. type ManagedconfigurationsforuserListCall struct {
  8792. s *Service
  8793. enterpriseId string
  8794. userId string
  8795. urlParams_ gensupport.URLParams
  8796. ifNoneMatch_ string
  8797. ctx_ context.Context
  8798. header_ http.Header
  8799. }
  8800. // List: Lists all the per-user managed configurations for the specified
  8801. // user. Only the ID is set.
  8802. func (r *ManagedconfigurationsforuserService) List(enterpriseId string, userId string) *ManagedconfigurationsforuserListCall {
  8803. c := &ManagedconfigurationsforuserListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8804. c.enterpriseId = enterpriseId
  8805. c.userId = userId
  8806. return c
  8807. }
  8808. // Fields allows partial responses to be retrieved. See
  8809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8810. // for more information.
  8811. func (c *ManagedconfigurationsforuserListCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserListCall {
  8812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8813. return c
  8814. }
  8815. // IfNoneMatch sets the optional parameter which makes the operation
  8816. // fail if the object's ETag matches the given value. This is useful for
  8817. // getting updates only after the object has changed since the last
  8818. // request. Use googleapi.IsNotModified to check whether the response
  8819. // error from Do is the result of In-None-Match.
  8820. func (c *ManagedconfigurationsforuserListCall) IfNoneMatch(entityTag string) *ManagedconfigurationsforuserListCall {
  8821. c.ifNoneMatch_ = entityTag
  8822. return c
  8823. }
  8824. // Context sets the context to be used in this call's Do method. Any
  8825. // pending HTTP request will be aborted if the provided context is
  8826. // canceled.
  8827. func (c *ManagedconfigurationsforuserListCall) Context(ctx context.Context) *ManagedconfigurationsforuserListCall {
  8828. c.ctx_ = ctx
  8829. return c
  8830. }
  8831. // Header returns an http.Header that can be modified by the caller to
  8832. // add HTTP headers to the request.
  8833. func (c *ManagedconfigurationsforuserListCall) Header() http.Header {
  8834. if c.header_ == nil {
  8835. c.header_ = make(http.Header)
  8836. }
  8837. return c.header_
  8838. }
  8839. func (c *ManagedconfigurationsforuserListCall) doRequest(alt string) (*http.Response, error) {
  8840. reqHeaders := make(http.Header)
  8841. for k, v := range c.header_ {
  8842. reqHeaders[k] = v
  8843. }
  8844. reqHeaders.Set("User-Agent", c.s.userAgent())
  8845. if c.ifNoneMatch_ != "" {
  8846. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8847. }
  8848. var body io.Reader = nil
  8849. c.urlParams_.Set("alt", alt)
  8850. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser")
  8851. urls += "?" + c.urlParams_.Encode()
  8852. req, _ := http.NewRequest("GET", urls, body)
  8853. req.Header = reqHeaders
  8854. googleapi.Expand(req.URL, map[string]string{
  8855. "enterpriseId": c.enterpriseId,
  8856. "userId": c.userId,
  8857. })
  8858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8859. }
  8860. // Do executes the "androidenterprise.managedconfigurationsforuser.list" call.
  8861. // Exactly one of *ManagedConfigurationsForUserListResponse or error
  8862. // will be non-nil. Any non-2xx status code is an error. Response
  8863. // headers are in either
  8864. // *ManagedConfigurationsForUserListResponse.ServerResponse.Header or
  8865. // (if a response was returned at all) in
  8866. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8867. // whether the returned error was because http.StatusNotModified was
  8868. // returned.
  8869. func (c *ManagedconfigurationsforuserListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsForUserListResponse, error) {
  8870. gensupport.SetOptions(c.urlParams_, opts...)
  8871. res, err := c.doRequest("json")
  8872. if res != nil && res.StatusCode == http.StatusNotModified {
  8873. if res.Body != nil {
  8874. res.Body.Close()
  8875. }
  8876. return nil, &googleapi.Error{
  8877. Code: res.StatusCode,
  8878. Header: res.Header,
  8879. }
  8880. }
  8881. if err != nil {
  8882. return nil, err
  8883. }
  8884. defer googleapi.CloseBody(res)
  8885. if err := googleapi.CheckResponse(res); err != nil {
  8886. return nil, err
  8887. }
  8888. ret := &ManagedConfigurationsForUserListResponse{
  8889. ServerResponse: googleapi.ServerResponse{
  8890. Header: res.Header,
  8891. HTTPStatusCode: res.StatusCode,
  8892. },
  8893. }
  8894. target := &ret
  8895. if err := gensupport.DecodeResponse(target, res); err != nil {
  8896. return nil, err
  8897. }
  8898. return ret, nil
  8899. // {
  8900. // "description": "Lists all the per-user managed configurations for the specified user. Only the ID is set.",
  8901. // "httpMethod": "GET",
  8902. // "id": "androidenterprise.managedconfigurationsforuser.list",
  8903. // "parameterOrder": [
  8904. // "enterpriseId",
  8905. // "userId"
  8906. // ],
  8907. // "parameters": {
  8908. // "enterpriseId": {
  8909. // "description": "The ID of the enterprise.",
  8910. // "location": "path",
  8911. // "required": true,
  8912. // "type": "string"
  8913. // },
  8914. // "userId": {
  8915. // "description": "The ID of the user.",
  8916. // "location": "path",
  8917. // "required": true,
  8918. // "type": "string"
  8919. // }
  8920. // },
  8921. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser",
  8922. // "response": {
  8923. // "$ref": "ManagedConfigurationsForUserListResponse"
  8924. // },
  8925. // "scopes": [
  8926. // "https://www.googleapis.com/auth/androidenterprise"
  8927. // ]
  8928. // }
  8929. }
  8930. // method id "androidenterprise.managedconfigurationsforuser.patch":
  8931. type ManagedconfigurationsforuserPatchCall struct {
  8932. s *Service
  8933. enterpriseId string
  8934. userId string
  8935. managedConfigurationForUserId string
  8936. managedconfiguration *ManagedConfiguration
  8937. urlParams_ gensupport.URLParams
  8938. ctx_ context.Context
  8939. header_ http.Header
  8940. }
  8941. // Patch: Adds or updates the managed configuration settings for an app
  8942. // for the specified user. If you support the Managed configurations
  8943. // iframe, you can apply managed configurations to a user by specifying
  8944. // an mcmId and its associated configuration variables (if any) in the
  8945. // request. Alternatively, all EMMs can apply managed configurations by
  8946. // passing a list of managed properties. This method supports patch
  8947. // semantics.
  8948. func (r *ManagedconfigurationsforuserService) Patch(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserPatchCall {
  8949. c := &ManagedconfigurationsforuserPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8950. c.enterpriseId = enterpriseId
  8951. c.userId = userId
  8952. c.managedConfigurationForUserId = managedConfigurationForUserId
  8953. c.managedconfiguration = managedconfiguration
  8954. return c
  8955. }
  8956. // Fields allows partial responses to be retrieved. See
  8957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8958. // for more information.
  8959. func (c *ManagedconfigurationsforuserPatchCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserPatchCall {
  8960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8961. return c
  8962. }
  8963. // Context sets the context to be used in this call's Do method. Any
  8964. // pending HTTP request will be aborted if the provided context is
  8965. // canceled.
  8966. func (c *ManagedconfigurationsforuserPatchCall) Context(ctx context.Context) *ManagedconfigurationsforuserPatchCall {
  8967. c.ctx_ = ctx
  8968. return c
  8969. }
  8970. // Header returns an http.Header that can be modified by the caller to
  8971. // add HTTP headers to the request.
  8972. func (c *ManagedconfigurationsforuserPatchCall) Header() http.Header {
  8973. if c.header_ == nil {
  8974. c.header_ = make(http.Header)
  8975. }
  8976. return c.header_
  8977. }
  8978. func (c *ManagedconfigurationsforuserPatchCall) doRequest(alt string) (*http.Response, error) {
  8979. reqHeaders := make(http.Header)
  8980. for k, v := range c.header_ {
  8981. reqHeaders[k] = v
  8982. }
  8983. reqHeaders.Set("User-Agent", c.s.userAgent())
  8984. var body io.Reader = nil
  8985. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  8986. if err != nil {
  8987. return nil, err
  8988. }
  8989. reqHeaders.Set("Content-Type", "application/json")
  8990. c.urlParams_.Set("alt", alt)
  8991. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  8992. urls += "?" + c.urlParams_.Encode()
  8993. req, _ := http.NewRequest("PATCH", urls, body)
  8994. req.Header = reqHeaders
  8995. googleapi.Expand(req.URL, map[string]string{
  8996. "enterpriseId": c.enterpriseId,
  8997. "userId": c.userId,
  8998. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  8999. })
  9000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9001. }
  9002. // Do executes the "androidenterprise.managedconfigurationsforuser.patch" call.
  9003. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  9004. // non-2xx status code is an error. Response headers are in either
  9005. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  9006. // returned at all) in error.(*googleapi.Error).Header. Use
  9007. // googleapi.IsNotModified to check whether the returned error was
  9008. // because http.StatusNotModified was returned.
  9009. func (c *ManagedconfigurationsforuserPatchCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  9010. gensupport.SetOptions(c.urlParams_, opts...)
  9011. res, err := c.doRequest("json")
  9012. if res != nil && res.StatusCode == http.StatusNotModified {
  9013. if res.Body != nil {
  9014. res.Body.Close()
  9015. }
  9016. return nil, &googleapi.Error{
  9017. Code: res.StatusCode,
  9018. Header: res.Header,
  9019. }
  9020. }
  9021. if err != nil {
  9022. return nil, err
  9023. }
  9024. defer googleapi.CloseBody(res)
  9025. if err := googleapi.CheckResponse(res); err != nil {
  9026. return nil, err
  9027. }
  9028. ret := &ManagedConfiguration{
  9029. ServerResponse: googleapi.ServerResponse{
  9030. Header: res.Header,
  9031. HTTPStatusCode: res.StatusCode,
  9032. },
  9033. }
  9034. target := &ret
  9035. if err := gensupport.DecodeResponse(target, res); err != nil {
  9036. return nil, err
  9037. }
  9038. return ret, nil
  9039. // {
  9040. // "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.",
  9041. // "httpMethod": "PATCH",
  9042. // "id": "androidenterprise.managedconfigurationsforuser.patch",
  9043. // "parameterOrder": [
  9044. // "enterpriseId",
  9045. // "userId",
  9046. // "managedConfigurationForUserId"
  9047. // ],
  9048. // "parameters": {
  9049. // "enterpriseId": {
  9050. // "description": "The ID of the enterprise.",
  9051. // "location": "path",
  9052. // "required": true,
  9053. // "type": "string"
  9054. // },
  9055. // "managedConfigurationForUserId": {
  9056. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  9057. // "location": "path",
  9058. // "required": true,
  9059. // "type": "string"
  9060. // },
  9061. // "userId": {
  9062. // "description": "The ID of the user.",
  9063. // "location": "path",
  9064. // "required": true,
  9065. // "type": "string"
  9066. // }
  9067. // },
  9068. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  9069. // "request": {
  9070. // "$ref": "ManagedConfiguration"
  9071. // },
  9072. // "response": {
  9073. // "$ref": "ManagedConfiguration"
  9074. // },
  9075. // "scopes": [
  9076. // "https://www.googleapis.com/auth/androidenterprise"
  9077. // ]
  9078. // }
  9079. }
  9080. // method id "androidenterprise.managedconfigurationsforuser.update":
  9081. type ManagedconfigurationsforuserUpdateCall struct {
  9082. s *Service
  9083. enterpriseId string
  9084. userId string
  9085. managedConfigurationForUserId string
  9086. managedconfiguration *ManagedConfiguration
  9087. urlParams_ gensupport.URLParams
  9088. ctx_ context.Context
  9089. header_ http.Header
  9090. }
  9091. // Update: Adds or updates the managed configuration settings for an app
  9092. // for the specified user. If you support the Managed configurations
  9093. // iframe, you can apply managed configurations to a user by specifying
  9094. // an mcmId and its associated configuration variables (if any) in the
  9095. // request. Alternatively, all EMMs can apply managed configurations by
  9096. // passing a list of managed properties.
  9097. func (r *ManagedconfigurationsforuserService) Update(enterpriseId string, userId string, managedConfigurationForUserId string, managedconfiguration *ManagedConfiguration) *ManagedconfigurationsforuserUpdateCall {
  9098. c := &ManagedconfigurationsforuserUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9099. c.enterpriseId = enterpriseId
  9100. c.userId = userId
  9101. c.managedConfigurationForUserId = managedConfigurationForUserId
  9102. c.managedconfiguration = managedconfiguration
  9103. return c
  9104. }
  9105. // Fields allows partial responses to be retrieved. See
  9106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9107. // for more information.
  9108. func (c *ManagedconfigurationsforuserUpdateCall) Fields(s ...googleapi.Field) *ManagedconfigurationsforuserUpdateCall {
  9109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9110. return c
  9111. }
  9112. // Context sets the context to be used in this call's Do method. Any
  9113. // pending HTTP request will be aborted if the provided context is
  9114. // canceled.
  9115. func (c *ManagedconfigurationsforuserUpdateCall) Context(ctx context.Context) *ManagedconfigurationsforuserUpdateCall {
  9116. c.ctx_ = ctx
  9117. return c
  9118. }
  9119. // Header returns an http.Header that can be modified by the caller to
  9120. // add HTTP headers to the request.
  9121. func (c *ManagedconfigurationsforuserUpdateCall) Header() http.Header {
  9122. if c.header_ == nil {
  9123. c.header_ = make(http.Header)
  9124. }
  9125. return c.header_
  9126. }
  9127. func (c *ManagedconfigurationsforuserUpdateCall) doRequest(alt string) (*http.Response, error) {
  9128. reqHeaders := make(http.Header)
  9129. for k, v := range c.header_ {
  9130. reqHeaders[k] = v
  9131. }
  9132. reqHeaders.Set("User-Agent", c.s.userAgent())
  9133. var body io.Reader = nil
  9134. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedconfiguration)
  9135. if err != nil {
  9136. return nil, err
  9137. }
  9138. reqHeaders.Set("Content-Type", "application/json")
  9139. c.urlParams_.Set("alt", alt)
  9140. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}")
  9141. urls += "?" + c.urlParams_.Encode()
  9142. req, _ := http.NewRequest("PUT", urls, body)
  9143. req.Header = reqHeaders
  9144. googleapi.Expand(req.URL, map[string]string{
  9145. "enterpriseId": c.enterpriseId,
  9146. "userId": c.userId,
  9147. "managedConfigurationForUserId": c.managedConfigurationForUserId,
  9148. })
  9149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9150. }
  9151. // Do executes the "androidenterprise.managedconfigurationsforuser.update" call.
  9152. // Exactly one of *ManagedConfiguration or error will be non-nil. Any
  9153. // non-2xx status code is an error. Response headers are in either
  9154. // *ManagedConfiguration.ServerResponse.Header or (if a response was
  9155. // returned at all) in error.(*googleapi.Error).Header. Use
  9156. // googleapi.IsNotModified to check whether the returned error was
  9157. // because http.StatusNotModified was returned.
  9158. func (c *ManagedconfigurationsforuserUpdateCall) Do(opts ...googleapi.CallOption) (*ManagedConfiguration, error) {
  9159. gensupport.SetOptions(c.urlParams_, opts...)
  9160. res, err := c.doRequest("json")
  9161. if res != nil && res.StatusCode == http.StatusNotModified {
  9162. if res.Body != nil {
  9163. res.Body.Close()
  9164. }
  9165. return nil, &googleapi.Error{
  9166. Code: res.StatusCode,
  9167. Header: res.Header,
  9168. }
  9169. }
  9170. if err != nil {
  9171. return nil, err
  9172. }
  9173. defer googleapi.CloseBody(res)
  9174. if err := googleapi.CheckResponse(res); err != nil {
  9175. return nil, err
  9176. }
  9177. ret := &ManagedConfiguration{
  9178. ServerResponse: googleapi.ServerResponse{
  9179. Header: res.Header,
  9180. HTTPStatusCode: res.StatusCode,
  9181. },
  9182. }
  9183. target := &ret
  9184. if err := gensupport.DecodeResponse(target, res); err != nil {
  9185. return nil, err
  9186. }
  9187. return ret, nil
  9188. // {
  9189. // "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.",
  9190. // "httpMethod": "PUT",
  9191. // "id": "androidenterprise.managedconfigurationsforuser.update",
  9192. // "parameterOrder": [
  9193. // "enterpriseId",
  9194. // "userId",
  9195. // "managedConfigurationForUserId"
  9196. // ],
  9197. // "parameters": {
  9198. // "enterpriseId": {
  9199. // "description": "The ID of the enterprise.",
  9200. // "location": "path",
  9201. // "required": true,
  9202. // "type": "string"
  9203. // },
  9204. // "managedConfigurationForUserId": {
  9205. // "description": "The ID of the managed configuration (a product ID), e.g. \"app:com.google.android.gm\".",
  9206. // "location": "path",
  9207. // "required": true,
  9208. // "type": "string"
  9209. // },
  9210. // "userId": {
  9211. // "description": "The ID of the user.",
  9212. // "location": "path",
  9213. // "required": true,
  9214. // "type": "string"
  9215. // }
  9216. // },
  9217. // "path": "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}",
  9218. // "request": {
  9219. // "$ref": "ManagedConfiguration"
  9220. // },
  9221. // "response": {
  9222. // "$ref": "ManagedConfiguration"
  9223. // },
  9224. // "scopes": [
  9225. // "https://www.googleapis.com/auth/androidenterprise"
  9226. // ]
  9227. // }
  9228. }
  9229. // method id "androidenterprise.managedconfigurationssettings.list":
  9230. type ManagedconfigurationssettingsListCall struct {
  9231. s *Service
  9232. enterpriseId string
  9233. productId string
  9234. urlParams_ gensupport.URLParams
  9235. ifNoneMatch_ string
  9236. ctx_ context.Context
  9237. header_ http.Header
  9238. }
  9239. // List: Lists all the managed configurations settings for the specified
  9240. // app. Only the ID and the name is set.
  9241. func (r *ManagedconfigurationssettingsService) List(enterpriseId string, productId string) *ManagedconfigurationssettingsListCall {
  9242. c := &ManagedconfigurationssettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9243. c.enterpriseId = enterpriseId
  9244. c.productId = productId
  9245. return c
  9246. }
  9247. // Fields allows partial responses to be retrieved. See
  9248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9249. // for more information.
  9250. func (c *ManagedconfigurationssettingsListCall) Fields(s ...googleapi.Field) *ManagedconfigurationssettingsListCall {
  9251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9252. return c
  9253. }
  9254. // IfNoneMatch sets the optional parameter which makes the operation
  9255. // fail if the object's ETag matches the given value. This is useful for
  9256. // getting updates only after the object has changed since the last
  9257. // request. Use googleapi.IsNotModified to check whether the response
  9258. // error from Do is the result of In-None-Match.
  9259. func (c *ManagedconfigurationssettingsListCall) IfNoneMatch(entityTag string) *ManagedconfigurationssettingsListCall {
  9260. c.ifNoneMatch_ = entityTag
  9261. return c
  9262. }
  9263. // Context sets the context to be used in this call's Do method. Any
  9264. // pending HTTP request will be aborted if the provided context is
  9265. // canceled.
  9266. func (c *ManagedconfigurationssettingsListCall) Context(ctx context.Context) *ManagedconfigurationssettingsListCall {
  9267. c.ctx_ = ctx
  9268. return c
  9269. }
  9270. // Header returns an http.Header that can be modified by the caller to
  9271. // add HTTP headers to the request.
  9272. func (c *ManagedconfigurationssettingsListCall) Header() http.Header {
  9273. if c.header_ == nil {
  9274. c.header_ = make(http.Header)
  9275. }
  9276. return c.header_
  9277. }
  9278. func (c *ManagedconfigurationssettingsListCall) doRequest(alt string) (*http.Response, error) {
  9279. reqHeaders := make(http.Header)
  9280. for k, v := range c.header_ {
  9281. reqHeaders[k] = v
  9282. }
  9283. reqHeaders.Set("User-Agent", c.s.userAgent())
  9284. if c.ifNoneMatch_ != "" {
  9285. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9286. }
  9287. var body io.Reader = nil
  9288. c.urlParams_.Set("alt", alt)
  9289. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings")
  9290. urls += "?" + c.urlParams_.Encode()
  9291. req, _ := http.NewRequest("GET", urls, body)
  9292. req.Header = reqHeaders
  9293. googleapi.Expand(req.URL, map[string]string{
  9294. "enterpriseId": c.enterpriseId,
  9295. "productId": c.productId,
  9296. })
  9297. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9298. }
  9299. // Do executes the "androidenterprise.managedconfigurationssettings.list" call.
  9300. // Exactly one of *ManagedConfigurationsSettingsListResponse or error
  9301. // will be non-nil. Any non-2xx status code is an error. Response
  9302. // headers are in either
  9303. // *ManagedConfigurationsSettingsListResponse.ServerResponse.Header or
  9304. // (if a response was returned at all) in
  9305. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9306. // whether the returned error was because http.StatusNotModified was
  9307. // returned.
  9308. func (c *ManagedconfigurationssettingsListCall) Do(opts ...googleapi.CallOption) (*ManagedConfigurationsSettingsListResponse, error) {
  9309. gensupport.SetOptions(c.urlParams_, opts...)
  9310. res, err := c.doRequest("json")
  9311. if res != nil && res.StatusCode == http.StatusNotModified {
  9312. if res.Body != nil {
  9313. res.Body.Close()
  9314. }
  9315. return nil, &googleapi.Error{
  9316. Code: res.StatusCode,
  9317. Header: res.Header,
  9318. }
  9319. }
  9320. if err != nil {
  9321. return nil, err
  9322. }
  9323. defer googleapi.CloseBody(res)
  9324. if err := googleapi.CheckResponse(res); err != nil {
  9325. return nil, err
  9326. }
  9327. ret := &ManagedConfigurationsSettingsListResponse{
  9328. ServerResponse: googleapi.ServerResponse{
  9329. Header: res.Header,
  9330. HTTPStatusCode: res.StatusCode,
  9331. },
  9332. }
  9333. target := &ret
  9334. if err := gensupport.DecodeResponse(target, res); err != nil {
  9335. return nil, err
  9336. }
  9337. return ret, nil
  9338. // {
  9339. // "description": "Lists all the managed configurations settings for the specified app. Only the ID and the name is set.",
  9340. // "httpMethod": "GET",
  9341. // "id": "androidenterprise.managedconfigurationssettings.list",
  9342. // "parameterOrder": [
  9343. // "enterpriseId",
  9344. // "productId"
  9345. // ],
  9346. // "parameters": {
  9347. // "enterpriseId": {
  9348. // "description": "The ID of the enterprise.",
  9349. // "location": "path",
  9350. // "required": true,
  9351. // "type": "string"
  9352. // },
  9353. // "productId": {
  9354. // "description": "The ID of the product for which the managed configurations settings applies to.",
  9355. // "location": "path",
  9356. // "required": true,
  9357. // "type": "string"
  9358. // }
  9359. // },
  9360. // "path": "enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings",
  9361. // "response": {
  9362. // "$ref": "ManagedConfigurationsSettingsListResponse"
  9363. // },
  9364. // "scopes": [
  9365. // "https://www.googleapis.com/auth/androidenterprise"
  9366. // ]
  9367. // }
  9368. }
  9369. // method id "androidenterprise.permissions.get":
  9370. type PermissionsGetCall struct {
  9371. s *Service
  9372. permissionId string
  9373. urlParams_ gensupport.URLParams
  9374. ifNoneMatch_ string
  9375. ctx_ context.Context
  9376. header_ http.Header
  9377. }
  9378. // Get: Retrieves details of an Android app permission for display to an
  9379. // enterprise admin.
  9380. func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall {
  9381. c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9382. c.permissionId = permissionId
  9383. return c
  9384. }
  9385. // Language sets the optional parameter "language": The BCP47 tag for
  9386. // the user's preferred language (e.g. "en-US", "de")
  9387. func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall {
  9388. c.urlParams_.Set("language", language)
  9389. return c
  9390. }
  9391. // Fields allows partial responses to be retrieved. See
  9392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9393. // for more information.
  9394. func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
  9395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9396. return c
  9397. }
  9398. // IfNoneMatch sets the optional parameter which makes the operation
  9399. // fail if the object's ETag matches the given value. This is useful for
  9400. // getting updates only after the object has changed since the last
  9401. // request. Use googleapi.IsNotModified to check whether the response
  9402. // error from Do is the result of In-None-Match.
  9403. func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
  9404. c.ifNoneMatch_ = entityTag
  9405. return c
  9406. }
  9407. // Context sets the context to be used in this call's Do method. Any
  9408. // pending HTTP request will be aborted if the provided context is
  9409. // canceled.
  9410. func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
  9411. c.ctx_ = ctx
  9412. return c
  9413. }
  9414. // Header returns an http.Header that can be modified by the caller to
  9415. // add HTTP headers to the request.
  9416. func (c *PermissionsGetCall) Header() http.Header {
  9417. if c.header_ == nil {
  9418. c.header_ = make(http.Header)
  9419. }
  9420. return c.header_
  9421. }
  9422. func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  9423. reqHeaders := make(http.Header)
  9424. for k, v := range c.header_ {
  9425. reqHeaders[k] = v
  9426. }
  9427. reqHeaders.Set("User-Agent", c.s.userAgent())
  9428. if c.ifNoneMatch_ != "" {
  9429. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9430. }
  9431. var body io.Reader = nil
  9432. c.urlParams_.Set("alt", alt)
  9433. urls := googleapi.ResolveRelative(c.s.BasePath, "permissions/{permissionId}")
  9434. urls += "?" + c.urlParams_.Encode()
  9435. req, _ := http.NewRequest("GET", urls, body)
  9436. req.Header = reqHeaders
  9437. googleapi.Expand(req.URL, map[string]string{
  9438. "permissionId": c.permissionId,
  9439. })
  9440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9441. }
  9442. // Do executes the "androidenterprise.permissions.get" call.
  9443. // Exactly one of *Permission or error will be non-nil. Any non-2xx
  9444. // status code is an error. Response headers are in either
  9445. // *Permission.ServerResponse.Header or (if a response was returned at
  9446. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9447. // to check whether the returned error was because
  9448. // http.StatusNotModified was returned.
  9449. func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
  9450. gensupport.SetOptions(c.urlParams_, opts...)
  9451. res, err := c.doRequest("json")
  9452. if res != nil && res.StatusCode == http.StatusNotModified {
  9453. if res.Body != nil {
  9454. res.Body.Close()
  9455. }
  9456. return nil, &googleapi.Error{
  9457. Code: res.StatusCode,
  9458. Header: res.Header,
  9459. }
  9460. }
  9461. if err != nil {
  9462. return nil, err
  9463. }
  9464. defer googleapi.CloseBody(res)
  9465. if err := googleapi.CheckResponse(res); err != nil {
  9466. return nil, err
  9467. }
  9468. ret := &Permission{
  9469. ServerResponse: googleapi.ServerResponse{
  9470. Header: res.Header,
  9471. HTTPStatusCode: res.StatusCode,
  9472. },
  9473. }
  9474. target := &ret
  9475. if err := gensupport.DecodeResponse(target, res); err != nil {
  9476. return nil, err
  9477. }
  9478. return ret, nil
  9479. // {
  9480. // "description": "Retrieves details of an Android app permission for display to an enterprise admin.",
  9481. // "httpMethod": "GET",
  9482. // "id": "androidenterprise.permissions.get",
  9483. // "parameterOrder": [
  9484. // "permissionId"
  9485. // ],
  9486. // "parameters": {
  9487. // "language": {
  9488. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")",
  9489. // "location": "query",
  9490. // "type": "string"
  9491. // },
  9492. // "permissionId": {
  9493. // "description": "The ID of the permission.",
  9494. // "location": "path",
  9495. // "required": true,
  9496. // "type": "string"
  9497. // }
  9498. // },
  9499. // "path": "permissions/{permissionId}",
  9500. // "response": {
  9501. // "$ref": "Permission"
  9502. // },
  9503. // "scopes": [
  9504. // "https://www.googleapis.com/auth/androidenterprise"
  9505. // ]
  9506. // }
  9507. }
  9508. // method id "androidenterprise.products.approve":
  9509. type ProductsApproveCall struct {
  9510. s *Service
  9511. enterpriseId string
  9512. productId string
  9513. productsapproverequest *ProductsApproveRequest
  9514. urlParams_ gensupport.URLParams
  9515. ctx_ context.Context
  9516. header_ http.Header
  9517. }
  9518. // Approve: Approves the specified product and the relevant app
  9519. // permissions, if any. The maximum number of products that you can
  9520. // approve per enterprise customer is 1,000.
  9521. //
  9522. // To learn how to use managed Google Play to design and create a store
  9523. // layout to display approved products to your users, see Store Layout
  9524. // Design.
  9525. func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall {
  9526. c := &ProductsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9527. c.enterpriseId = enterpriseId
  9528. c.productId = productId
  9529. c.productsapproverequest = productsapproverequest
  9530. return c
  9531. }
  9532. // Fields allows partial responses to be retrieved. See
  9533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9534. // for more information.
  9535. func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall {
  9536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9537. return c
  9538. }
  9539. // Context sets the context to be used in this call's Do method. Any
  9540. // pending HTTP request will be aborted if the provided context is
  9541. // canceled.
  9542. func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall {
  9543. c.ctx_ = ctx
  9544. return c
  9545. }
  9546. // Header returns an http.Header that can be modified by the caller to
  9547. // add HTTP headers to the request.
  9548. func (c *ProductsApproveCall) Header() http.Header {
  9549. if c.header_ == nil {
  9550. c.header_ = make(http.Header)
  9551. }
  9552. return c.header_
  9553. }
  9554. func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) {
  9555. reqHeaders := make(http.Header)
  9556. for k, v := range c.header_ {
  9557. reqHeaders[k] = v
  9558. }
  9559. reqHeaders.Set("User-Agent", c.s.userAgent())
  9560. var body io.Reader = nil
  9561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest)
  9562. if err != nil {
  9563. return nil, err
  9564. }
  9565. reqHeaders.Set("Content-Type", "application/json")
  9566. c.urlParams_.Set("alt", alt)
  9567. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/approve")
  9568. urls += "?" + c.urlParams_.Encode()
  9569. req, _ := http.NewRequest("POST", urls, body)
  9570. req.Header = reqHeaders
  9571. googleapi.Expand(req.URL, map[string]string{
  9572. "enterpriseId": c.enterpriseId,
  9573. "productId": c.productId,
  9574. })
  9575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9576. }
  9577. // Do executes the "androidenterprise.products.approve" call.
  9578. func (c *ProductsApproveCall) Do(opts ...googleapi.CallOption) error {
  9579. gensupport.SetOptions(c.urlParams_, opts...)
  9580. res, err := c.doRequest("json")
  9581. if err != nil {
  9582. return err
  9583. }
  9584. defer googleapi.CloseBody(res)
  9585. if err := googleapi.CheckResponse(res); err != nil {
  9586. return err
  9587. }
  9588. return nil
  9589. // {
  9590. // "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.",
  9591. // "httpMethod": "POST",
  9592. // "id": "androidenterprise.products.approve",
  9593. // "parameterOrder": [
  9594. // "enterpriseId",
  9595. // "productId"
  9596. // ],
  9597. // "parameters": {
  9598. // "enterpriseId": {
  9599. // "description": "The ID of the enterprise.",
  9600. // "location": "path",
  9601. // "required": true,
  9602. // "type": "string"
  9603. // },
  9604. // "productId": {
  9605. // "description": "The ID of the product.",
  9606. // "location": "path",
  9607. // "required": true,
  9608. // "type": "string"
  9609. // }
  9610. // },
  9611. // "path": "enterprises/{enterpriseId}/products/{productId}/approve",
  9612. // "request": {
  9613. // "$ref": "ProductsApproveRequest"
  9614. // },
  9615. // "scopes": [
  9616. // "https://www.googleapis.com/auth/androidenterprise"
  9617. // ]
  9618. // }
  9619. }
  9620. // method id "androidenterprise.products.generateApprovalUrl":
  9621. type ProductsGenerateApprovalUrlCall struct {
  9622. s *Service
  9623. enterpriseId string
  9624. productId string
  9625. urlParams_ gensupport.URLParams
  9626. ctx_ context.Context
  9627. header_ http.Header
  9628. }
  9629. // GenerateApprovalUrl: Generates a URL that can be rendered in an
  9630. // iframe to display the permissions (if any) of a product. An
  9631. // enterprise admin must view these permissions and accept them on
  9632. // behalf of their organization in order to approve that
  9633. // product.
  9634. //
  9635. // Admins should accept the displayed permissions by interacting with a
  9636. // separate UI element in the EMM console, which in turn should trigger
  9637. // the use of this URL as the approvalUrlInfo.approvalUrl property in a
  9638. // Products.approve call to approve the product. This URL can only be
  9639. // used to display permissions for up to 1 day.
  9640. func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall {
  9641. c := &ProductsGenerateApprovalUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9642. c.enterpriseId = enterpriseId
  9643. c.productId = productId
  9644. return c
  9645. }
  9646. // LanguageCode sets the optional parameter "languageCode": The BCP 47
  9647. // language code used for permission names and descriptions in the
  9648. // returned iframe, for instance "en-US".
  9649. func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall {
  9650. c.urlParams_.Set("languageCode", languageCode)
  9651. return c
  9652. }
  9653. // Fields allows partial responses to be retrieved. See
  9654. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9655. // for more information.
  9656. func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall {
  9657. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9658. return c
  9659. }
  9660. // Context sets the context to be used in this call's Do method. Any
  9661. // pending HTTP request will be aborted if the provided context is
  9662. // canceled.
  9663. func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall {
  9664. c.ctx_ = ctx
  9665. return c
  9666. }
  9667. // Header returns an http.Header that can be modified by the caller to
  9668. // add HTTP headers to the request.
  9669. func (c *ProductsGenerateApprovalUrlCall) Header() http.Header {
  9670. if c.header_ == nil {
  9671. c.header_ = make(http.Header)
  9672. }
  9673. return c.header_
  9674. }
  9675. func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) {
  9676. reqHeaders := make(http.Header)
  9677. for k, v := range c.header_ {
  9678. reqHeaders[k] = v
  9679. }
  9680. reqHeaders.Set("User-Agent", c.s.userAgent())
  9681. var body io.Reader = nil
  9682. c.urlParams_.Set("alt", alt)
  9683. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl")
  9684. urls += "?" + c.urlParams_.Encode()
  9685. req, _ := http.NewRequest("POST", urls, body)
  9686. req.Header = reqHeaders
  9687. googleapi.Expand(req.URL, map[string]string{
  9688. "enterpriseId": c.enterpriseId,
  9689. "productId": c.productId,
  9690. })
  9691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9692. }
  9693. // Do executes the "androidenterprise.products.generateApprovalUrl" call.
  9694. // Exactly one of *ProductsGenerateApprovalUrlResponse or error will be
  9695. // non-nil. Any non-2xx status code is an error. Response headers are in
  9696. // either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or
  9697. // (if a response was returned at all) in
  9698. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9699. // whether the returned error was because http.StatusNotModified was
  9700. // returned.
  9701. func (c *ProductsGenerateApprovalUrlCall) Do(opts ...googleapi.CallOption) (*ProductsGenerateApprovalUrlResponse, error) {
  9702. gensupport.SetOptions(c.urlParams_, opts...)
  9703. res, err := c.doRequest("json")
  9704. if res != nil && res.StatusCode == http.StatusNotModified {
  9705. if res.Body != nil {
  9706. res.Body.Close()
  9707. }
  9708. return nil, &googleapi.Error{
  9709. Code: res.StatusCode,
  9710. Header: res.Header,
  9711. }
  9712. }
  9713. if err != nil {
  9714. return nil, err
  9715. }
  9716. defer googleapi.CloseBody(res)
  9717. if err := googleapi.CheckResponse(res); err != nil {
  9718. return nil, err
  9719. }
  9720. ret := &ProductsGenerateApprovalUrlResponse{
  9721. ServerResponse: googleapi.ServerResponse{
  9722. Header: res.Header,
  9723. HTTPStatusCode: res.StatusCode,
  9724. },
  9725. }
  9726. target := &ret
  9727. if err := gensupport.DecodeResponse(target, res); err != nil {
  9728. return nil, err
  9729. }
  9730. return ret, nil
  9731. // {
  9732. // "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.",
  9733. // "httpMethod": "POST",
  9734. // "id": "androidenterprise.products.generateApprovalUrl",
  9735. // "parameterOrder": [
  9736. // "enterpriseId",
  9737. // "productId"
  9738. // ],
  9739. // "parameters": {
  9740. // "enterpriseId": {
  9741. // "description": "The ID of the enterprise.",
  9742. // "location": "path",
  9743. // "required": true,
  9744. // "type": "string"
  9745. // },
  9746. // "languageCode": {
  9747. // "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".",
  9748. // "location": "query",
  9749. // "type": "string"
  9750. // },
  9751. // "productId": {
  9752. // "description": "The ID of the product.",
  9753. // "location": "path",
  9754. // "required": true,
  9755. // "type": "string"
  9756. // }
  9757. // },
  9758. // "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl",
  9759. // "response": {
  9760. // "$ref": "ProductsGenerateApprovalUrlResponse"
  9761. // },
  9762. // "scopes": [
  9763. // "https://www.googleapis.com/auth/androidenterprise"
  9764. // ]
  9765. // }
  9766. }
  9767. // method id "androidenterprise.products.get":
  9768. type ProductsGetCall struct {
  9769. s *Service
  9770. enterpriseId string
  9771. productId string
  9772. urlParams_ gensupport.URLParams
  9773. ifNoneMatch_ string
  9774. ctx_ context.Context
  9775. header_ http.Header
  9776. }
  9777. // Get: Retrieves details of a product for display to an enterprise
  9778. // admin.
  9779. func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall {
  9780. c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9781. c.enterpriseId = enterpriseId
  9782. c.productId = productId
  9783. return c
  9784. }
  9785. // Language sets the optional parameter "language": The BCP47 tag for
  9786. // the user's preferred language (e.g. "en-US", "de").
  9787. func (c *ProductsGetCall) Language(language string) *ProductsGetCall {
  9788. c.urlParams_.Set("language", language)
  9789. return c
  9790. }
  9791. // Fields allows partial responses to be retrieved. See
  9792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9793. // for more information.
  9794. func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
  9795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9796. return c
  9797. }
  9798. // IfNoneMatch sets the optional parameter which makes the operation
  9799. // fail if the object's ETag matches the given value. This is useful for
  9800. // getting updates only after the object has changed since the last
  9801. // request. Use googleapi.IsNotModified to check whether the response
  9802. // error from Do is the result of In-None-Match.
  9803. func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
  9804. c.ifNoneMatch_ = entityTag
  9805. return c
  9806. }
  9807. // Context sets the context to be used in this call's Do method. Any
  9808. // pending HTTP request will be aborted if the provided context is
  9809. // canceled.
  9810. func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
  9811. c.ctx_ = ctx
  9812. return c
  9813. }
  9814. // Header returns an http.Header that can be modified by the caller to
  9815. // add HTTP headers to the request.
  9816. func (c *ProductsGetCall) Header() http.Header {
  9817. if c.header_ == nil {
  9818. c.header_ = make(http.Header)
  9819. }
  9820. return c.header_
  9821. }
  9822. func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
  9823. reqHeaders := make(http.Header)
  9824. for k, v := range c.header_ {
  9825. reqHeaders[k] = v
  9826. }
  9827. reqHeaders.Set("User-Agent", c.s.userAgent())
  9828. if c.ifNoneMatch_ != "" {
  9829. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9830. }
  9831. var body io.Reader = nil
  9832. c.urlParams_.Set("alt", alt)
  9833. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}")
  9834. urls += "?" + c.urlParams_.Encode()
  9835. req, _ := http.NewRequest("GET", urls, body)
  9836. req.Header = reqHeaders
  9837. googleapi.Expand(req.URL, map[string]string{
  9838. "enterpriseId": c.enterpriseId,
  9839. "productId": c.productId,
  9840. })
  9841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9842. }
  9843. // Do executes the "androidenterprise.products.get" call.
  9844. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  9845. // code is an error. Response headers are in either
  9846. // *Product.ServerResponse.Header or (if a response was returned at all)
  9847. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9848. // check whether the returned error was because http.StatusNotModified
  9849. // was returned.
  9850. func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  9851. gensupport.SetOptions(c.urlParams_, opts...)
  9852. res, err := c.doRequest("json")
  9853. if res != nil && res.StatusCode == http.StatusNotModified {
  9854. if res.Body != nil {
  9855. res.Body.Close()
  9856. }
  9857. return nil, &googleapi.Error{
  9858. Code: res.StatusCode,
  9859. Header: res.Header,
  9860. }
  9861. }
  9862. if err != nil {
  9863. return nil, err
  9864. }
  9865. defer googleapi.CloseBody(res)
  9866. if err := googleapi.CheckResponse(res); err != nil {
  9867. return nil, err
  9868. }
  9869. ret := &Product{
  9870. ServerResponse: googleapi.ServerResponse{
  9871. Header: res.Header,
  9872. HTTPStatusCode: res.StatusCode,
  9873. },
  9874. }
  9875. target := &ret
  9876. if err := gensupport.DecodeResponse(target, res); err != nil {
  9877. return nil, err
  9878. }
  9879. return ret, nil
  9880. // {
  9881. // "description": "Retrieves details of a product for display to an enterprise admin.",
  9882. // "httpMethod": "GET",
  9883. // "id": "androidenterprise.products.get",
  9884. // "parameterOrder": [
  9885. // "enterpriseId",
  9886. // "productId"
  9887. // ],
  9888. // "parameters": {
  9889. // "enterpriseId": {
  9890. // "description": "The ID of the enterprise.",
  9891. // "location": "path",
  9892. // "required": true,
  9893. // "type": "string"
  9894. // },
  9895. // "language": {
  9896. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
  9897. // "location": "query",
  9898. // "type": "string"
  9899. // },
  9900. // "productId": {
  9901. // "description": "The ID of the product, e.g. \"app:com.google.android.gm\".",
  9902. // "location": "path",
  9903. // "required": true,
  9904. // "type": "string"
  9905. // }
  9906. // },
  9907. // "path": "enterprises/{enterpriseId}/products/{productId}",
  9908. // "response": {
  9909. // "$ref": "Product"
  9910. // },
  9911. // "scopes": [
  9912. // "https://www.googleapis.com/auth/androidenterprise"
  9913. // ]
  9914. // }
  9915. }
  9916. // method id "androidenterprise.products.getAppRestrictionsSchema":
  9917. type ProductsGetAppRestrictionsSchemaCall struct {
  9918. s *Service
  9919. enterpriseId string
  9920. productId string
  9921. urlParams_ gensupport.URLParams
  9922. ifNoneMatch_ string
  9923. ctx_ context.Context
  9924. header_ http.Header
  9925. }
  9926. // GetAppRestrictionsSchema: Retrieves the schema that defines the
  9927. // configurable properties for this product. All products have a schema,
  9928. // but this schema may be empty if no managed configurations have been
  9929. // defined. This schema can be used to populate a UI that allows an
  9930. // admin to configure the product. To apply a managed configuration
  9931. // based on the schema obtained using this API, see Managed
  9932. // Configurations through Play.
  9933. func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall {
  9934. c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9935. c.enterpriseId = enterpriseId
  9936. c.productId = productId
  9937. return c
  9938. }
  9939. // Language sets the optional parameter "language": The BCP47 tag for
  9940. // the user's preferred language (e.g. "en-US", "de").
  9941. func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall {
  9942. c.urlParams_.Set("language", language)
  9943. return c
  9944. }
  9945. // Fields allows partial responses to be retrieved. See
  9946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9947. // for more information.
  9948. func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall {
  9949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9950. return c
  9951. }
  9952. // IfNoneMatch sets the optional parameter which makes the operation
  9953. // fail if the object's ETag matches the given value. This is useful for
  9954. // getting updates only after the object has changed since the last
  9955. // request. Use googleapi.IsNotModified to check whether the response
  9956. // error from Do is the result of In-None-Match.
  9957. func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall {
  9958. c.ifNoneMatch_ = entityTag
  9959. return c
  9960. }
  9961. // Context sets the context to be used in this call's Do method. Any
  9962. // pending HTTP request will be aborted if the provided context is
  9963. // canceled.
  9964. func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall {
  9965. c.ctx_ = ctx
  9966. return c
  9967. }
  9968. // Header returns an http.Header that can be modified by the caller to
  9969. // add HTTP headers to the request.
  9970. func (c *ProductsGetAppRestrictionsSchemaCall) Header() http.Header {
  9971. if c.header_ == nil {
  9972. c.header_ = make(http.Header)
  9973. }
  9974. return c.header_
  9975. }
  9976. func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) {
  9977. reqHeaders := make(http.Header)
  9978. for k, v := range c.header_ {
  9979. reqHeaders[k] = v
  9980. }
  9981. reqHeaders.Set("User-Agent", c.s.userAgent())
  9982. if c.ifNoneMatch_ != "" {
  9983. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9984. }
  9985. var body io.Reader = nil
  9986. c.urlParams_.Set("alt", alt)
  9987. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema")
  9988. urls += "?" + c.urlParams_.Encode()
  9989. req, _ := http.NewRequest("GET", urls, body)
  9990. req.Header = reqHeaders
  9991. googleapi.Expand(req.URL, map[string]string{
  9992. "enterpriseId": c.enterpriseId,
  9993. "productId": c.productId,
  9994. })
  9995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9996. }
  9997. // Do executes the "androidenterprise.products.getAppRestrictionsSchema" call.
  9998. // Exactly one of *AppRestrictionsSchema or error will be non-nil. Any
  9999. // non-2xx status code is an error. Response headers are in either
  10000. // *AppRestrictionsSchema.ServerResponse.Header or (if a response was
  10001. // returned at all) in error.(*googleapi.Error).Header. Use
  10002. // googleapi.IsNotModified to check whether the returned error was
  10003. // because http.StatusNotModified was returned.
  10004. func (c *ProductsGetAppRestrictionsSchemaCall) Do(opts ...googleapi.CallOption) (*AppRestrictionsSchema, error) {
  10005. gensupport.SetOptions(c.urlParams_, opts...)
  10006. res, err := c.doRequest("json")
  10007. if res != nil && res.StatusCode == http.StatusNotModified {
  10008. if res.Body != nil {
  10009. res.Body.Close()
  10010. }
  10011. return nil, &googleapi.Error{
  10012. Code: res.StatusCode,
  10013. Header: res.Header,
  10014. }
  10015. }
  10016. if err != nil {
  10017. return nil, err
  10018. }
  10019. defer googleapi.CloseBody(res)
  10020. if err := googleapi.CheckResponse(res); err != nil {
  10021. return nil, err
  10022. }
  10023. ret := &AppRestrictionsSchema{
  10024. ServerResponse: googleapi.ServerResponse{
  10025. Header: res.Header,
  10026. HTTPStatusCode: res.StatusCode,
  10027. },
  10028. }
  10029. target := &ret
  10030. if err := gensupport.DecodeResponse(target, res); err != nil {
  10031. return nil, err
  10032. }
  10033. return ret, nil
  10034. // {
  10035. // "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.",
  10036. // "httpMethod": "GET",
  10037. // "id": "androidenterprise.products.getAppRestrictionsSchema",
  10038. // "parameterOrder": [
  10039. // "enterpriseId",
  10040. // "productId"
  10041. // ],
  10042. // "parameters": {
  10043. // "enterpriseId": {
  10044. // "description": "The ID of the enterprise.",
  10045. // "location": "path",
  10046. // "required": true,
  10047. // "type": "string"
  10048. // },
  10049. // "language": {
  10050. // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
  10051. // "location": "query",
  10052. // "type": "string"
  10053. // },
  10054. // "productId": {
  10055. // "description": "The ID of the product.",
  10056. // "location": "path",
  10057. // "required": true,
  10058. // "type": "string"
  10059. // }
  10060. // },
  10061. // "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema",
  10062. // "response": {
  10063. // "$ref": "AppRestrictionsSchema"
  10064. // },
  10065. // "scopes": [
  10066. // "https://www.googleapis.com/auth/androidenterprise"
  10067. // ]
  10068. // }
  10069. }
  10070. // method id "androidenterprise.products.getPermissions":
  10071. type ProductsGetPermissionsCall struct {
  10072. s *Service
  10073. enterpriseId string
  10074. productId string
  10075. urlParams_ gensupport.URLParams
  10076. ifNoneMatch_ string
  10077. ctx_ context.Context
  10078. header_ http.Header
  10079. }
  10080. // GetPermissions: Retrieves the Android app permissions required by
  10081. // this app.
  10082. func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall {
  10083. c := &ProductsGetPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10084. c.enterpriseId = enterpriseId
  10085. c.productId = productId
  10086. return c
  10087. }
  10088. // Fields allows partial responses to be retrieved. See
  10089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10090. // for more information.
  10091. func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall {
  10092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10093. return c
  10094. }
  10095. // IfNoneMatch sets the optional parameter which makes the operation
  10096. // fail if the object's ETag matches the given value. This is useful for
  10097. // getting updates only after the object has changed since the last
  10098. // request. Use googleapi.IsNotModified to check whether the response
  10099. // error from Do is the result of In-None-Match.
  10100. func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall {
  10101. c.ifNoneMatch_ = entityTag
  10102. return c
  10103. }
  10104. // Context sets the context to be used in this call's Do method. Any
  10105. // pending HTTP request will be aborted if the provided context is
  10106. // canceled.
  10107. func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall {
  10108. c.ctx_ = ctx
  10109. return c
  10110. }
  10111. // Header returns an http.Header that can be modified by the caller to
  10112. // add HTTP headers to the request.
  10113. func (c *ProductsGetPermissionsCall) Header() http.Header {
  10114. if c.header_ == nil {
  10115. c.header_ = make(http.Header)
  10116. }
  10117. return c.header_
  10118. }
  10119. func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) {
  10120. reqHeaders := make(http.Header)
  10121. for k, v := range c.header_ {
  10122. reqHeaders[k] = v
  10123. }
  10124. reqHeaders.Set("User-Agent", c.s.userAgent())
  10125. if c.ifNoneMatch_ != "" {
  10126. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10127. }
  10128. var body io.Reader = nil
  10129. c.urlParams_.Set("alt", alt)
  10130. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions")
  10131. urls += "?" + c.urlParams_.Encode()
  10132. req, _ := http.NewRequest("GET", urls, body)
  10133. req.Header = reqHeaders
  10134. googleapi.Expand(req.URL, map[string]string{
  10135. "enterpriseId": c.enterpriseId,
  10136. "productId": c.productId,
  10137. })
  10138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10139. }
  10140. // Do executes the "androidenterprise.products.getPermissions" call.
  10141. // Exactly one of *ProductPermissions or error will be non-nil. Any
  10142. // non-2xx status code is an error. Response headers are in either
  10143. // *ProductPermissions.ServerResponse.Header or (if a response was
  10144. // returned at all) in error.(*googleapi.Error).Header. Use
  10145. // googleapi.IsNotModified to check whether the returned error was
  10146. // because http.StatusNotModified was returned.
  10147. func (c *ProductsGetPermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) {
  10148. gensupport.SetOptions(c.urlParams_, opts...)
  10149. res, err := c.doRequest("json")
  10150. if res != nil && res.StatusCode == http.StatusNotModified {
  10151. if res.Body != nil {
  10152. res.Body.Close()
  10153. }
  10154. return nil, &googleapi.Error{
  10155. Code: res.StatusCode,
  10156. Header: res.Header,
  10157. }
  10158. }
  10159. if err != nil {
  10160. return nil, err
  10161. }
  10162. defer googleapi.CloseBody(res)
  10163. if err := googleapi.CheckResponse(res); err != nil {
  10164. return nil, err
  10165. }
  10166. ret := &ProductPermissions{
  10167. ServerResponse: googleapi.ServerResponse{
  10168. Header: res.Header,
  10169. HTTPStatusCode: res.StatusCode,
  10170. },
  10171. }
  10172. target := &ret
  10173. if err := gensupport.DecodeResponse(target, res); err != nil {
  10174. return nil, err
  10175. }
  10176. return ret, nil
  10177. // {
  10178. // "description": "Retrieves the Android app permissions required by this app.",
  10179. // "httpMethod": "GET",
  10180. // "id": "androidenterprise.products.getPermissions",
  10181. // "parameterOrder": [
  10182. // "enterpriseId",
  10183. // "productId"
  10184. // ],
  10185. // "parameters": {
  10186. // "enterpriseId": {
  10187. // "description": "The ID of the enterprise.",
  10188. // "location": "path",
  10189. // "required": true,
  10190. // "type": "string"
  10191. // },
  10192. // "productId": {
  10193. // "description": "The ID of the product.",
  10194. // "location": "path",
  10195. // "required": true,
  10196. // "type": "string"
  10197. // }
  10198. // },
  10199. // "path": "enterprises/{enterpriseId}/products/{productId}/permissions",
  10200. // "response": {
  10201. // "$ref": "ProductPermissions"
  10202. // },
  10203. // "scopes": [
  10204. // "https://www.googleapis.com/auth/androidenterprise"
  10205. // ]
  10206. // }
  10207. }
  10208. // method id "androidenterprise.products.list":
  10209. type ProductsListCall struct {
  10210. s *Service
  10211. enterpriseId string
  10212. urlParams_ gensupport.URLParams
  10213. ifNoneMatch_ string
  10214. ctx_ context.Context
  10215. header_ http.Header
  10216. }
  10217. // List: Finds approved products that match a query, or all approved
  10218. // products if there is no query.
  10219. func (r *ProductsService) List(enterpriseId string) *ProductsListCall {
  10220. c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10221. c.enterpriseId = enterpriseId
  10222. return c
  10223. }
  10224. // Approved sets the optional parameter "approved": Specifies whether to
  10225. // search among all products (false) or among only products that have
  10226. // been approved (true). Only "true" is supported, and should be
  10227. // specified.
  10228. func (c *ProductsListCall) Approved(approved bool) *ProductsListCall {
  10229. c.urlParams_.Set("approved", fmt.Sprint(approved))
  10230. return c
  10231. }
  10232. // Language sets the optional parameter "language": The BCP47 tag for
  10233. // the user's preferred language (e.g. "en-US", "de"). Results are
  10234. // returned in the language best matching the preferred language.
  10235. func (c *ProductsListCall) Language(language string) *ProductsListCall {
  10236. c.urlParams_.Set("language", language)
  10237. return c
  10238. }
  10239. // MaxResults sets the optional parameter "maxResults": Specifies the
  10240. // maximum number of products that can be returned per request. If not
  10241. // specified, uses a default value of 100, which is also the maximum
  10242. // retrievable within a single response.
  10243. func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall {
  10244. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10245. return c
  10246. }
  10247. // Query sets the optional parameter "query": The search query as typed
  10248. // in the Google Play store search box. If omitted, all approved apps
  10249. // will be returned (using the pagination parameters), including apps
  10250. // that are not available in the store (e.g. unpublished apps).
  10251. func (c *ProductsListCall) Query(query string) *ProductsListCall {
  10252. c.urlParams_.Set("query", query)
  10253. return c
  10254. }
  10255. // Token sets the optional parameter "token": A pagination token is
  10256. // contained in a request''s response when there are more products. The
  10257. // token can be used in a subsequent request to obtain more products,
  10258. // and so forth. This parameter cannot be used in the initial request.
  10259. func (c *ProductsListCall) Token(token string) *ProductsListCall {
  10260. c.urlParams_.Set("token", token)
  10261. return c
  10262. }
  10263. // Fields allows partial responses to be retrieved. See
  10264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10265. // for more information.
  10266. func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall {
  10267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10268. return c
  10269. }
  10270. // IfNoneMatch sets the optional parameter which makes the operation
  10271. // fail if the object's ETag matches the given value. This is useful for
  10272. // getting updates only after the object has changed since the last
  10273. // request. Use googleapi.IsNotModified to check whether the response
  10274. // error from Do is the result of In-None-Match.
  10275. func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall {
  10276. c.ifNoneMatch_ = entityTag
  10277. return c
  10278. }
  10279. // Context sets the context to be used in this call's Do method. Any
  10280. // pending HTTP request will be aborted if the provided context is
  10281. // canceled.
  10282. func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall {
  10283. c.ctx_ = ctx
  10284. return c
  10285. }
  10286. // Header returns an http.Header that can be modified by the caller to
  10287. // add HTTP headers to the request.
  10288. func (c *ProductsListCall) Header() http.Header {
  10289. if c.header_ == nil {
  10290. c.header_ = make(http.Header)
  10291. }
  10292. return c.header_
  10293. }
  10294. func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) {
  10295. reqHeaders := make(http.Header)
  10296. for k, v := range c.header_ {
  10297. reqHeaders[k] = v
  10298. }
  10299. reqHeaders.Set("User-Agent", c.s.userAgent())
  10300. if c.ifNoneMatch_ != "" {
  10301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10302. }
  10303. var body io.Reader = nil
  10304. c.urlParams_.Set("alt", alt)
  10305. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products")
  10306. urls += "?" + c.urlParams_.Encode()
  10307. req, _ := http.NewRequest("GET", urls, body)
  10308. req.Header = reqHeaders
  10309. googleapi.Expand(req.URL, map[string]string{
  10310. "enterpriseId": c.enterpriseId,
  10311. })
  10312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10313. }
  10314. // Do executes the "androidenterprise.products.list" call.
  10315. // Exactly one of *ProductsListResponse or error will be non-nil. Any
  10316. // non-2xx status code is an error. Response headers are in either
  10317. // *ProductsListResponse.ServerResponse.Header or (if a response was
  10318. // returned at all) in error.(*googleapi.Error).Header. Use
  10319. // googleapi.IsNotModified to check whether the returned error was
  10320. // because http.StatusNotModified was returned.
  10321. func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) {
  10322. gensupport.SetOptions(c.urlParams_, opts...)
  10323. res, err := c.doRequest("json")
  10324. if res != nil && res.StatusCode == http.StatusNotModified {
  10325. if res.Body != nil {
  10326. res.Body.Close()
  10327. }
  10328. return nil, &googleapi.Error{
  10329. Code: res.StatusCode,
  10330. Header: res.Header,
  10331. }
  10332. }
  10333. if err != nil {
  10334. return nil, err
  10335. }
  10336. defer googleapi.CloseBody(res)
  10337. if err := googleapi.CheckResponse(res); err != nil {
  10338. return nil, err
  10339. }
  10340. ret := &ProductsListResponse{
  10341. ServerResponse: googleapi.ServerResponse{
  10342. Header: res.Header,
  10343. HTTPStatusCode: res.StatusCode,
  10344. },
  10345. }
  10346. target := &ret
  10347. if err := gensupport.DecodeResponse(target, res); err != nil {
  10348. return nil, err
  10349. }
  10350. return ret, nil
  10351. // {
  10352. // "description": "Finds approved products that match a query, or all approved products if there is no query.",
  10353. // "httpMethod": "GET",
  10354. // "id": "androidenterprise.products.list",
  10355. // "parameterOrder": [
  10356. // "enterpriseId"
  10357. // ],
  10358. // "parameters": {
  10359. // "approved": {
  10360. // "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.",
  10361. // "location": "query",
  10362. // "type": "boolean"
  10363. // },
  10364. // "enterpriseId": {
  10365. // "description": "The ID of the enterprise.",
  10366. // "location": "path",
  10367. // "required": true,
  10368. // "type": "string"
  10369. // },
  10370. // "language": {
  10371. // "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.",
  10372. // "location": "query",
  10373. // "type": "string"
  10374. // },
  10375. // "maxResults": {
  10376. // "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.",
  10377. // "format": "uint32",
  10378. // "location": "query",
  10379. // "type": "integer"
  10380. // },
  10381. // "query": {
  10382. // "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).",
  10383. // "location": "query",
  10384. // "type": "string"
  10385. // },
  10386. // "token": {
  10387. // "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.",
  10388. // "location": "query",
  10389. // "type": "string"
  10390. // }
  10391. // },
  10392. // "path": "enterprises/{enterpriseId}/products",
  10393. // "response": {
  10394. // "$ref": "ProductsListResponse"
  10395. // },
  10396. // "scopes": [
  10397. // "https://www.googleapis.com/auth/androidenterprise"
  10398. // ]
  10399. // }
  10400. }
  10401. // method id "androidenterprise.products.unapprove":
  10402. type ProductsUnapproveCall struct {
  10403. s *Service
  10404. enterpriseId string
  10405. productId string
  10406. urlParams_ gensupport.URLParams
  10407. ctx_ context.Context
  10408. header_ http.Header
  10409. }
  10410. // Unapprove: Unapproves the specified product (and the relevant app
  10411. // permissions, if any)
  10412. func (r *ProductsService) Unapprove(enterpriseId string, productId string) *ProductsUnapproveCall {
  10413. c := &ProductsUnapproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10414. c.enterpriseId = enterpriseId
  10415. c.productId = productId
  10416. return c
  10417. }
  10418. // Fields allows partial responses to be retrieved. See
  10419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10420. // for more information.
  10421. func (c *ProductsUnapproveCall) Fields(s ...googleapi.Field) *ProductsUnapproveCall {
  10422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10423. return c
  10424. }
  10425. // Context sets the context to be used in this call's Do method. Any
  10426. // pending HTTP request will be aborted if the provided context is
  10427. // canceled.
  10428. func (c *ProductsUnapproveCall) Context(ctx context.Context) *ProductsUnapproveCall {
  10429. c.ctx_ = ctx
  10430. return c
  10431. }
  10432. // Header returns an http.Header that can be modified by the caller to
  10433. // add HTTP headers to the request.
  10434. func (c *ProductsUnapproveCall) Header() http.Header {
  10435. if c.header_ == nil {
  10436. c.header_ = make(http.Header)
  10437. }
  10438. return c.header_
  10439. }
  10440. func (c *ProductsUnapproveCall) doRequest(alt string) (*http.Response, error) {
  10441. reqHeaders := make(http.Header)
  10442. for k, v := range c.header_ {
  10443. reqHeaders[k] = v
  10444. }
  10445. reqHeaders.Set("User-Agent", c.s.userAgent())
  10446. var body io.Reader = nil
  10447. c.urlParams_.Set("alt", alt)
  10448. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/unapprove")
  10449. urls += "?" + c.urlParams_.Encode()
  10450. req, _ := http.NewRequest("POST", urls, body)
  10451. req.Header = reqHeaders
  10452. googleapi.Expand(req.URL, map[string]string{
  10453. "enterpriseId": c.enterpriseId,
  10454. "productId": c.productId,
  10455. })
  10456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10457. }
  10458. // Do executes the "androidenterprise.products.unapprove" call.
  10459. func (c *ProductsUnapproveCall) Do(opts ...googleapi.CallOption) error {
  10460. gensupport.SetOptions(c.urlParams_, opts...)
  10461. res, err := c.doRequest("json")
  10462. if err != nil {
  10463. return err
  10464. }
  10465. defer googleapi.CloseBody(res)
  10466. if err := googleapi.CheckResponse(res); err != nil {
  10467. return err
  10468. }
  10469. return nil
  10470. // {
  10471. // "description": "Unapproves the specified product (and the relevant app permissions, if any)",
  10472. // "httpMethod": "POST",
  10473. // "id": "androidenterprise.products.unapprove",
  10474. // "parameterOrder": [
  10475. // "enterpriseId",
  10476. // "productId"
  10477. // ],
  10478. // "parameters": {
  10479. // "enterpriseId": {
  10480. // "description": "The ID of the enterprise.",
  10481. // "location": "path",
  10482. // "required": true,
  10483. // "type": "string"
  10484. // },
  10485. // "productId": {
  10486. // "description": "The ID of the product.",
  10487. // "location": "path",
  10488. // "required": true,
  10489. // "type": "string"
  10490. // }
  10491. // },
  10492. // "path": "enterprises/{enterpriseId}/products/{productId}/unapprove",
  10493. // "scopes": [
  10494. // "https://www.googleapis.com/auth/androidenterprise"
  10495. // ]
  10496. // }
  10497. }
  10498. // method id "androidenterprise.serviceaccountkeys.delete":
  10499. type ServiceaccountkeysDeleteCall struct {
  10500. s *Service
  10501. enterpriseId string
  10502. keyId string
  10503. urlParams_ gensupport.URLParams
  10504. ctx_ context.Context
  10505. header_ http.Header
  10506. }
  10507. // Delete: Removes and invalidates the specified credentials for the
  10508. // service account associated with this enterprise. The calling service
  10509. // account must have been retrieved by calling
  10510. // Enterprises.GetServiceAccount and must have been set as the
  10511. // enterprise service account by calling Enterprises.SetAccount.
  10512. func (r *ServiceaccountkeysService) Delete(enterpriseId string, keyId string) *ServiceaccountkeysDeleteCall {
  10513. c := &ServiceaccountkeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10514. c.enterpriseId = enterpriseId
  10515. c.keyId = keyId
  10516. return c
  10517. }
  10518. // Fields allows partial responses to be retrieved. See
  10519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10520. // for more information.
  10521. func (c *ServiceaccountkeysDeleteCall) Fields(s ...googleapi.Field) *ServiceaccountkeysDeleteCall {
  10522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10523. return c
  10524. }
  10525. // Context sets the context to be used in this call's Do method. Any
  10526. // pending HTTP request will be aborted if the provided context is
  10527. // canceled.
  10528. func (c *ServiceaccountkeysDeleteCall) Context(ctx context.Context) *ServiceaccountkeysDeleteCall {
  10529. c.ctx_ = ctx
  10530. return c
  10531. }
  10532. // Header returns an http.Header that can be modified by the caller to
  10533. // add HTTP headers to the request.
  10534. func (c *ServiceaccountkeysDeleteCall) Header() http.Header {
  10535. if c.header_ == nil {
  10536. c.header_ = make(http.Header)
  10537. }
  10538. return c.header_
  10539. }
  10540. func (c *ServiceaccountkeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  10541. reqHeaders := make(http.Header)
  10542. for k, v := range c.header_ {
  10543. reqHeaders[k] = v
  10544. }
  10545. reqHeaders.Set("User-Agent", c.s.userAgent())
  10546. var body io.Reader = nil
  10547. c.urlParams_.Set("alt", alt)
  10548. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys/{keyId}")
  10549. urls += "?" + c.urlParams_.Encode()
  10550. req, _ := http.NewRequest("DELETE", urls, body)
  10551. req.Header = reqHeaders
  10552. googleapi.Expand(req.URL, map[string]string{
  10553. "enterpriseId": c.enterpriseId,
  10554. "keyId": c.keyId,
  10555. })
  10556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10557. }
  10558. // Do executes the "androidenterprise.serviceaccountkeys.delete" call.
  10559. func (c *ServiceaccountkeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  10560. gensupport.SetOptions(c.urlParams_, opts...)
  10561. res, err := c.doRequest("json")
  10562. if err != nil {
  10563. return err
  10564. }
  10565. defer googleapi.CloseBody(res)
  10566. if err := googleapi.CheckResponse(res); err != nil {
  10567. return err
  10568. }
  10569. return nil
  10570. // {
  10571. // "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.",
  10572. // "httpMethod": "DELETE",
  10573. // "id": "androidenterprise.serviceaccountkeys.delete",
  10574. // "parameterOrder": [
  10575. // "enterpriseId",
  10576. // "keyId"
  10577. // ],
  10578. // "parameters": {
  10579. // "enterpriseId": {
  10580. // "description": "The ID of the enterprise.",
  10581. // "location": "path",
  10582. // "required": true,
  10583. // "type": "string"
  10584. // },
  10585. // "keyId": {
  10586. // "description": "The ID of the key.",
  10587. // "location": "path",
  10588. // "required": true,
  10589. // "type": "string"
  10590. // }
  10591. // },
  10592. // "path": "enterprises/{enterpriseId}/serviceAccountKeys/{keyId}",
  10593. // "scopes": [
  10594. // "https://www.googleapis.com/auth/androidenterprise"
  10595. // ]
  10596. // }
  10597. }
  10598. // method id "androidenterprise.serviceaccountkeys.insert":
  10599. type ServiceaccountkeysInsertCall struct {
  10600. s *Service
  10601. enterpriseId string
  10602. serviceaccountkey *ServiceAccountKey
  10603. urlParams_ gensupport.URLParams
  10604. ctx_ context.Context
  10605. header_ http.Header
  10606. }
  10607. // Insert: Generates new credentials for the service account associated
  10608. // with this enterprise. The calling service account must have been
  10609. // retrieved by calling Enterprises.GetServiceAccount and must have been
  10610. // set as the enterprise service account by calling
  10611. // Enterprises.SetAccount.
  10612. //
  10613. // Only the type of the key should be populated in the resource to be
  10614. // inserted.
  10615. func (r *ServiceaccountkeysService) Insert(enterpriseId string, serviceaccountkey *ServiceAccountKey) *ServiceaccountkeysInsertCall {
  10616. c := &ServiceaccountkeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10617. c.enterpriseId = enterpriseId
  10618. c.serviceaccountkey = serviceaccountkey
  10619. return c
  10620. }
  10621. // Fields allows partial responses to be retrieved. See
  10622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10623. // for more information.
  10624. func (c *ServiceaccountkeysInsertCall) Fields(s ...googleapi.Field) *ServiceaccountkeysInsertCall {
  10625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10626. return c
  10627. }
  10628. // Context sets the context to be used in this call's Do method. Any
  10629. // pending HTTP request will be aborted if the provided context is
  10630. // canceled.
  10631. func (c *ServiceaccountkeysInsertCall) Context(ctx context.Context) *ServiceaccountkeysInsertCall {
  10632. c.ctx_ = ctx
  10633. return c
  10634. }
  10635. // Header returns an http.Header that can be modified by the caller to
  10636. // add HTTP headers to the request.
  10637. func (c *ServiceaccountkeysInsertCall) Header() http.Header {
  10638. if c.header_ == nil {
  10639. c.header_ = make(http.Header)
  10640. }
  10641. return c.header_
  10642. }
  10643. func (c *ServiceaccountkeysInsertCall) doRequest(alt string) (*http.Response, error) {
  10644. reqHeaders := make(http.Header)
  10645. for k, v := range c.header_ {
  10646. reqHeaders[k] = v
  10647. }
  10648. reqHeaders.Set("User-Agent", c.s.userAgent())
  10649. var body io.Reader = nil
  10650. body, err := googleapi.WithoutDataWrapper.JSONReader(c.serviceaccountkey)
  10651. if err != nil {
  10652. return nil, err
  10653. }
  10654. reqHeaders.Set("Content-Type", "application/json")
  10655. c.urlParams_.Set("alt", alt)
  10656. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys")
  10657. urls += "?" + c.urlParams_.Encode()
  10658. req, _ := http.NewRequest("POST", urls, body)
  10659. req.Header = reqHeaders
  10660. googleapi.Expand(req.URL, map[string]string{
  10661. "enterpriseId": c.enterpriseId,
  10662. })
  10663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10664. }
  10665. // Do executes the "androidenterprise.serviceaccountkeys.insert" call.
  10666. // Exactly one of *ServiceAccountKey or error will be non-nil. Any
  10667. // non-2xx status code is an error. Response headers are in either
  10668. // *ServiceAccountKey.ServerResponse.Header or (if a response was
  10669. // returned at all) in error.(*googleapi.Error).Header. Use
  10670. // googleapi.IsNotModified to check whether the returned error was
  10671. // because http.StatusNotModified was returned.
  10672. func (c *ServiceaccountkeysInsertCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKey, error) {
  10673. gensupport.SetOptions(c.urlParams_, opts...)
  10674. res, err := c.doRequest("json")
  10675. if res != nil && res.StatusCode == http.StatusNotModified {
  10676. if res.Body != nil {
  10677. res.Body.Close()
  10678. }
  10679. return nil, &googleapi.Error{
  10680. Code: res.StatusCode,
  10681. Header: res.Header,
  10682. }
  10683. }
  10684. if err != nil {
  10685. return nil, err
  10686. }
  10687. defer googleapi.CloseBody(res)
  10688. if err := googleapi.CheckResponse(res); err != nil {
  10689. return nil, err
  10690. }
  10691. ret := &ServiceAccountKey{
  10692. ServerResponse: googleapi.ServerResponse{
  10693. Header: res.Header,
  10694. HTTPStatusCode: res.StatusCode,
  10695. },
  10696. }
  10697. target := &ret
  10698. if err := gensupport.DecodeResponse(target, res); err != nil {
  10699. return nil, err
  10700. }
  10701. return ret, nil
  10702. // {
  10703. // "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.",
  10704. // "httpMethod": "POST",
  10705. // "id": "androidenterprise.serviceaccountkeys.insert",
  10706. // "parameterOrder": [
  10707. // "enterpriseId"
  10708. // ],
  10709. // "parameters": {
  10710. // "enterpriseId": {
  10711. // "description": "The ID of the enterprise.",
  10712. // "location": "path",
  10713. // "required": true,
  10714. // "type": "string"
  10715. // }
  10716. // },
  10717. // "path": "enterprises/{enterpriseId}/serviceAccountKeys",
  10718. // "request": {
  10719. // "$ref": "ServiceAccountKey"
  10720. // },
  10721. // "response": {
  10722. // "$ref": "ServiceAccountKey"
  10723. // },
  10724. // "scopes": [
  10725. // "https://www.googleapis.com/auth/androidenterprise"
  10726. // ]
  10727. // }
  10728. }
  10729. // method id "androidenterprise.serviceaccountkeys.list":
  10730. type ServiceaccountkeysListCall struct {
  10731. s *Service
  10732. enterpriseId string
  10733. urlParams_ gensupport.URLParams
  10734. ifNoneMatch_ string
  10735. ctx_ context.Context
  10736. header_ http.Header
  10737. }
  10738. // List: Lists all active credentials for the service account associated
  10739. // with this enterprise. Only the ID and key type are returned. The
  10740. // calling service account must have been retrieved by calling
  10741. // Enterprises.GetServiceAccount and must have been set as the
  10742. // enterprise service account by calling Enterprises.SetAccount.
  10743. func (r *ServiceaccountkeysService) List(enterpriseId string) *ServiceaccountkeysListCall {
  10744. c := &ServiceaccountkeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10745. c.enterpriseId = enterpriseId
  10746. return c
  10747. }
  10748. // Fields allows partial responses to be retrieved. See
  10749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10750. // for more information.
  10751. func (c *ServiceaccountkeysListCall) Fields(s ...googleapi.Field) *ServiceaccountkeysListCall {
  10752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10753. return c
  10754. }
  10755. // IfNoneMatch sets the optional parameter which makes the operation
  10756. // fail if the object's ETag matches the given value. This is useful for
  10757. // getting updates only after the object has changed since the last
  10758. // request. Use googleapi.IsNotModified to check whether the response
  10759. // error from Do is the result of In-None-Match.
  10760. func (c *ServiceaccountkeysListCall) IfNoneMatch(entityTag string) *ServiceaccountkeysListCall {
  10761. c.ifNoneMatch_ = entityTag
  10762. return c
  10763. }
  10764. // Context sets the context to be used in this call's Do method. Any
  10765. // pending HTTP request will be aborted if the provided context is
  10766. // canceled.
  10767. func (c *ServiceaccountkeysListCall) Context(ctx context.Context) *ServiceaccountkeysListCall {
  10768. c.ctx_ = ctx
  10769. return c
  10770. }
  10771. // Header returns an http.Header that can be modified by the caller to
  10772. // add HTTP headers to the request.
  10773. func (c *ServiceaccountkeysListCall) Header() http.Header {
  10774. if c.header_ == nil {
  10775. c.header_ = make(http.Header)
  10776. }
  10777. return c.header_
  10778. }
  10779. func (c *ServiceaccountkeysListCall) doRequest(alt string) (*http.Response, error) {
  10780. reqHeaders := make(http.Header)
  10781. for k, v := range c.header_ {
  10782. reqHeaders[k] = v
  10783. }
  10784. reqHeaders.Set("User-Agent", c.s.userAgent())
  10785. if c.ifNoneMatch_ != "" {
  10786. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10787. }
  10788. var body io.Reader = nil
  10789. c.urlParams_.Set("alt", alt)
  10790. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/serviceAccountKeys")
  10791. urls += "?" + c.urlParams_.Encode()
  10792. req, _ := http.NewRequest("GET", urls, body)
  10793. req.Header = reqHeaders
  10794. googleapi.Expand(req.URL, map[string]string{
  10795. "enterpriseId": c.enterpriseId,
  10796. })
  10797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10798. }
  10799. // Do executes the "androidenterprise.serviceaccountkeys.list" call.
  10800. // Exactly one of *ServiceAccountKeysListResponse or error will be
  10801. // non-nil. Any non-2xx status code is an error. Response headers are in
  10802. // either *ServiceAccountKeysListResponse.ServerResponse.Header or (if a
  10803. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10804. // googleapi.IsNotModified to check whether the returned error was
  10805. // because http.StatusNotModified was returned.
  10806. func (c *ServiceaccountkeysListCall) Do(opts ...googleapi.CallOption) (*ServiceAccountKeysListResponse, error) {
  10807. gensupport.SetOptions(c.urlParams_, opts...)
  10808. res, err := c.doRequest("json")
  10809. if res != nil && res.StatusCode == http.StatusNotModified {
  10810. if res.Body != nil {
  10811. res.Body.Close()
  10812. }
  10813. return nil, &googleapi.Error{
  10814. Code: res.StatusCode,
  10815. Header: res.Header,
  10816. }
  10817. }
  10818. if err != nil {
  10819. return nil, err
  10820. }
  10821. defer googleapi.CloseBody(res)
  10822. if err := googleapi.CheckResponse(res); err != nil {
  10823. return nil, err
  10824. }
  10825. ret := &ServiceAccountKeysListResponse{
  10826. ServerResponse: googleapi.ServerResponse{
  10827. Header: res.Header,
  10828. HTTPStatusCode: res.StatusCode,
  10829. },
  10830. }
  10831. target := &ret
  10832. if err := gensupport.DecodeResponse(target, res); err != nil {
  10833. return nil, err
  10834. }
  10835. return ret, nil
  10836. // {
  10837. // "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.",
  10838. // "httpMethod": "GET",
  10839. // "id": "androidenterprise.serviceaccountkeys.list",
  10840. // "parameterOrder": [
  10841. // "enterpriseId"
  10842. // ],
  10843. // "parameters": {
  10844. // "enterpriseId": {
  10845. // "description": "The ID of the enterprise.",
  10846. // "location": "path",
  10847. // "required": true,
  10848. // "type": "string"
  10849. // }
  10850. // },
  10851. // "path": "enterprises/{enterpriseId}/serviceAccountKeys",
  10852. // "response": {
  10853. // "$ref": "ServiceAccountKeysListResponse"
  10854. // },
  10855. // "scopes": [
  10856. // "https://www.googleapis.com/auth/androidenterprise"
  10857. // ]
  10858. // }
  10859. }
  10860. // method id "androidenterprise.storelayoutclusters.delete":
  10861. type StorelayoutclustersDeleteCall struct {
  10862. s *Service
  10863. enterpriseId string
  10864. pageId string
  10865. clusterId string
  10866. urlParams_ gensupport.URLParams
  10867. ctx_ context.Context
  10868. header_ http.Header
  10869. }
  10870. // Delete: Deletes a cluster.
  10871. func (r *StorelayoutclustersService) Delete(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersDeleteCall {
  10872. c := &StorelayoutclustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10873. c.enterpriseId = enterpriseId
  10874. c.pageId = pageId
  10875. c.clusterId = clusterId
  10876. return c
  10877. }
  10878. // Fields allows partial responses to be retrieved. See
  10879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10880. // for more information.
  10881. func (c *StorelayoutclustersDeleteCall) Fields(s ...googleapi.Field) *StorelayoutclustersDeleteCall {
  10882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10883. return c
  10884. }
  10885. // Context sets the context to be used in this call's Do method. Any
  10886. // pending HTTP request will be aborted if the provided context is
  10887. // canceled.
  10888. func (c *StorelayoutclustersDeleteCall) Context(ctx context.Context) *StorelayoutclustersDeleteCall {
  10889. c.ctx_ = ctx
  10890. return c
  10891. }
  10892. // Header returns an http.Header that can be modified by the caller to
  10893. // add HTTP headers to the request.
  10894. func (c *StorelayoutclustersDeleteCall) Header() http.Header {
  10895. if c.header_ == nil {
  10896. c.header_ = make(http.Header)
  10897. }
  10898. return c.header_
  10899. }
  10900. func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  10901. reqHeaders := make(http.Header)
  10902. for k, v := range c.header_ {
  10903. reqHeaders[k] = v
  10904. }
  10905. reqHeaders.Set("User-Agent", c.s.userAgent())
  10906. var body io.Reader = nil
  10907. c.urlParams_.Set("alt", alt)
  10908. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  10909. urls += "?" + c.urlParams_.Encode()
  10910. req, _ := http.NewRequest("DELETE", urls, body)
  10911. req.Header = reqHeaders
  10912. googleapi.Expand(req.URL, map[string]string{
  10913. "enterpriseId": c.enterpriseId,
  10914. "pageId": c.pageId,
  10915. "clusterId": c.clusterId,
  10916. })
  10917. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10918. }
  10919. // Do executes the "androidenterprise.storelayoutclusters.delete" call.
  10920. func (c *StorelayoutclustersDeleteCall) Do(opts ...googleapi.CallOption) error {
  10921. gensupport.SetOptions(c.urlParams_, opts...)
  10922. res, err := c.doRequest("json")
  10923. if err != nil {
  10924. return err
  10925. }
  10926. defer googleapi.CloseBody(res)
  10927. if err := googleapi.CheckResponse(res); err != nil {
  10928. return err
  10929. }
  10930. return nil
  10931. // {
  10932. // "description": "Deletes a cluster.",
  10933. // "httpMethod": "DELETE",
  10934. // "id": "androidenterprise.storelayoutclusters.delete",
  10935. // "parameterOrder": [
  10936. // "enterpriseId",
  10937. // "pageId",
  10938. // "clusterId"
  10939. // ],
  10940. // "parameters": {
  10941. // "clusterId": {
  10942. // "description": "The ID of the cluster.",
  10943. // "location": "path",
  10944. // "required": true,
  10945. // "type": "string"
  10946. // },
  10947. // "enterpriseId": {
  10948. // "description": "The ID of the enterprise.",
  10949. // "location": "path",
  10950. // "required": true,
  10951. // "type": "string"
  10952. // },
  10953. // "pageId": {
  10954. // "description": "The ID of the page.",
  10955. // "location": "path",
  10956. // "required": true,
  10957. // "type": "string"
  10958. // }
  10959. // },
  10960. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  10961. // "scopes": [
  10962. // "https://www.googleapis.com/auth/androidenterprise"
  10963. // ]
  10964. // }
  10965. }
  10966. // method id "androidenterprise.storelayoutclusters.get":
  10967. type StorelayoutclustersGetCall struct {
  10968. s *Service
  10969. enterpriseId string
  10970. pageId string
  10971. clusterId string
  10972. urlParams_ gensupport.URLParams
  10973. ifNoneMatch_ string
  10974. ctx_ context.Context
  10975. header_ http.Header
  10976. }
  10977. // Get: Retrieves details of a cluster.
  10978. func (r *StorelayoutclustersService) Get(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersGetCall {
  10979. c := &StorelayoutclustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10980. c.enterpriseId = enterpriseId
  10981. c.pageId = pageId
  10982. c.clusterId = clusterId
  10983. return c
  10984. }
  10985. // Fields allows partial responses to be retrieved. See
  10986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10987. // for more information.
  10988. func (c *StorelayoutclustersGetCall) Fields(s ...googleapi.Field) *StorelayoutclustersGetCall {
  10989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10990. return c
  10991. }
  10992. // IfNoneMatch sets the optional parameter which makes the operation
  10993. // fail if the object's ETag matches the given value. This is useful for
  10994. // getting updates only after the object has changed since the last
  10995. // request. Use googleapi.IsNotModified to check whether the response
  10996. // error from Do is the result of In-None-Match.
  10997. func (c *StorelayoutclustersGetCall) IfNoneMatch(entityTag string) *StorelayoutclustersGetCall {
  10998. c.ifNoneMatch_ = entityTag
  10999. return c
  11000. }
  11001. // Context sets the context to be used in this call's Do method. Any
  11002. // pending HTTP request will be aborted if the provided context is
  11003. // canceled.
  11004. func (c *StorelayoutclustersGetCall) Context(ctx context.Context) *StorelayoutclustersGetCall {
  11005. c.ctx_ = ctx
  11006. return c
  11007. }
  11008. // Header returns an http.Header that can be modified by the caller to
  11009. // add HTTP headers to the request.
  11010. func (c *StorelayoutclustersGetCall) Header() http.Header {
  11011. if c.header_ == nil {
  11012. c.header_ = make(http.Header)
  11013. }
  11014. return c.header_
  11015. }
  11016. func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, error) {
  11017. reqHeaders := make(http.Header)
  11018. for k, v := range c.header_ {
  11019. reqHeaders[k] = v
  11020. }
  11021. reqHeaders.Set("User-Agent", c.s.userAgent())
  11022. if c.ifNoneMatch_ != "" {
  11023. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11024. }
  11025. var body io.Reader = nil
  11026. c.urlParams_.Set("alt", alt)
  11027. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11028. urls += "?" + c.urlParams_.Encode()
  11029. req, _ := http.NewRequest("GET", urls, body)
  11030. req.Header = reqHeaders
  11031. googleapi.Expand(req.URL, map[string]string{
  11032. "enterpriseId": c.enterpriseId,
  11033. "pageId": c.pageId,
  11034. "clusterId": c.clusterId,
  11035. })
  11036. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11037. }
  11038. // Do executes the "androidenterprise.storelayoutclusters.get" call.
  11039. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11040. // status code is an error. Response headers are in either
  11041. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11042. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11043. // to check whether the returned error was because
  11044. // http.StatusNotModified was returned.
  11045. func (c *StorelayoutclustersGetCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11046. gensupport.SetOptions(c.urlParams_, opts...)
  11047. res, err := c.doRequest("json")
  11048. if res != nil && res.StatusCode == http.StatusNotModified {
  11049. if res.Body != nil {
  11050. res.Body.Close()
  11051. }
  11052. return nil, &googleapi.Error{
  11053. Code: res.StatusCode,
  11054. Header: res.Header,
  11055. }
  11056. }
  11057. if err != nil {
  11058. return nil, err
  11059. }
  11060. defer googleapi.CloseBody(res)
  11061. if err := googleapi.CheckResponse(res); err != nil {
  11062. return nil, err
  11063. }
  11064. ret := &StoreCluster{
  11065. ServerResponse: googleapi.ServerResponse{
  11066. Header: res.Header,
  11067. HTTPStatusCode: res.StatusCode,
  11068. },
  11069. }
  11070. target := &ret
  11071. if err := gensupport.DecodeResponse(target, res); err != nil {
  11072. return nil, err
  11073. }
  11074. return ret, nil
  11075. // {
  11076. // "description": "Retrieves details of a cluster.",
  11077. // "httpMethod": "GET",
  11078. // "id": "androidenterprise.storelayoutclusters.get",
  11079. // "parameterOrder": [
  11080. // "enterpriseId",
  11081. // "pageId",
  11082. // "clusterId"
  11083. // ],
  11084. // "parameters": {
  11085. // "clusterId": {
  11086. // "description": "The ID of the cluster.",
  11087. // "location": "path",
  11088. // "required": true,
  11089. // "type": "string"
  11090. // },
  11091. // "enterpriseId": {
  11092. // "description": "The ID of the enterprise.",
  11093. // "location": "path",
  11094. // "required": true,
  11095. // "type": "string"
  11096. // },
  11097. // "pageId": {
  11098. // "description": "The ID of the page.",
  11099. // "location": "path",
  11100. // "required": true,
  11101. // "type": "string"
  11102. // }
  11103. // },
  11104. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11105. // "response": {
  11106. // "$ref": "StoreCluster"
  11107. // },
  11108. // "scopes": [
  11109. // "https://www.googleapis.com/auth/androidenterprise"
  11110. // ]
  11111. // }
  11112. }
  11113. // method id "androidenterprise.storelayoutclusters.insert":
  11114. type StorelayoutclustersInsertCall struct {
  11115. s *Service
  11116. enterpriseId string
  11117. pageId string
  11118. storecluster *StoreCluster
  11119. urlParams_ gensupport.URLParams
  11120. ctx_ context.Context
  11121. header_ http.Header
  11122. }
  11123. // Insert: Inserts a new cluster in a page.
  11124. func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall {
  11125. c := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11126. c.enterpriseId = enterpriseId
  11127. c.pageId = pageId
  11128. c.storecluster = storecluster
  11129. return c
  11130. }
  11131. // Fields allows partial responses to be retrieved. See
  11132. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11133. // for more information.
  11134. func (c *StorelayoutclustersInsertCall) Fields(s ...googleapi.Field) *StorelayoutclustersInsertCall {
  11135. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11136. return c
  11137. }
  11138. // Context sets the context to be used in this call's Do method. Any
  11139. // pending HTTP request will be aborted if the provided context is
  11140. // canceled.
  11141. func (c *StorelayoutclustersInsertCall) Context(ctx context.Context) *StorelayoutclustersInsertCall {
  11142. c.ctx_ = ctx
  11143. return c
  11144. }
  11145. // Header returns an http.Header that can be modified by the caller to
  11146. // add HTTP headers to the request.
  11147. func (c *StorelayoutclustersInsertCall) Header() http.Header {
  11148. if c.header_ == nil {
  11149. c.header_ = make(http.Header)
  11150. }
  11151. return c.header_
  11152. }
  11153. func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) {
  11154. reqHeaders := make(http.Header)
  11155. for k, v := range c.header_ {
  11156. reqHeaders[k] = v
  11157. }
  11158. reqHeaders.Set("User-Agent", c.s.userAgent())
  11159. var body io.Reader = nil
  11160. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
  11161. if err != nil {
  11162. return nil, err
  11163. }
  11164. reqHeaders.Set("Content-Type", "application/json")
  11165. c.urlParams_.Set("alt", alt)
  11166. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters")
  11167. urls += "?" + c.urlParams_.Encode()
  11168. req, _ := http.NewRequest("POST", urls, body)
  11169. req.Header = reqHeaders
  11170. googleapi.Expand(req.URL, map[string]string{
  11171. "enterpriseId": c.enterpriseId,
  11172. "pageId": c.pageId,
  11173. })
  11174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11175. }
  11176. // Do executes the "androidenterprise.storelayoutclusters.insert" call.
  11177. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11178. // status code is an error. Response headers are in either
  11179. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11180. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11181. // to check whether the returned error was because
  11182. // http.StatusNotModified was returned.
  11183. func (c *StorelayoutclustersInsertCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11184. gensupport.SetOptions(c.urlParams_, opts...)
  11185. res, err := c.doRequest("json")
  11186. if res != nil && res.StatusCode == http.StatusNotModified {
  11187. if res.Body != nil {
  11188. res.Body.Close()
  11189. }
  11190. return nil, &googleapi.Error{
  11191. Code: res.StatusCode,
  11192. Header: res.Header,
  11193. }
  11194. }
  11195. if err != nil {
  11196. return nil, err
  11197. }
  11198. defer googleapi.CloseBody(res)
  11199. if err := googleapi.CheckResponse(res); err != nil {
  11200. return nil, err
  11201. }
  11202. ret := &StoreCluster{
  11203. ServerResponse: googleapi.ServerResponse{
  11204. Header: res.Header,
  11205. HTTPStatusCode: res.StatusCode,
  11206. },
  11207. }
  11208. target := &ret
  11209. if err := gensupport.DecodeResponse(target, res); err != nil {
  11210. return nil, err
  11211. }
  11212. return ret, nil
  11213. // {
  11214. // "description": "Inserts a new cluster in a page.",
  11215. // "httpMethod": "POST",
  11216. // "id": "androidenterprise.storelayoutclusters.insert",
  11217. // "parameterOrder": [
  11218. // "enterpriseId",
  11219. // "pageId"
  11220. // ],
  11221. // "parameters": {
  11222. // "enterpriseId": {
  11223. // "description": "The ID of the enterprise.",
  11224. // "location": "path",
  11225. // "required": true,
  11226. // "type": "string"
  11227. // },
  11228. // "pageId": {
  11229. // "description": "The ID of the page.",
  11230. // "location": "path",
  11231. // "required": true,
  11232. // "type": "string"
  11233. // }
  11234. // },
  11235. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters",
  11236. // "request": {
  11237. // "$ref": "StoreCluster"
  11238. // },
  11239. // "response": {
  11240. // "$ref": "StoreCluster"
  11241. // },
  11242. // "scopes": [
  11243. // "https://www.googleapis.com/auth/androidenterprise"
  11244. // ]
  11245. // }
  11246. }
  11247. // method id "androidenterprise.storelayoutclusters.list":
  11248. type StorelayoutclustersListCall struct {
  11249. s *Service
  11250. enterpriseId string
  11251. pageId string
  11252. urlParams_ gensupport.URLParams
  11253. ifNoneMatch_ string
  11254. ctx_ context.Context
  11255. header_ http.Header
  11256. }
  11257. // List: Retrieves the details of all clusters on the specified page.
  11258. func (r *StorelayoutclustersService) List(enterpriseId string, pageId string) *StorelayoutclustersListCall {
  11259. c := &StorelayoutclustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11260. c.enterpriseId = enterpriseId
  11261. c.pageId = pageId
  11262. return c
  11263. }
  11264. // Fields allows partial responses to be retrieved. See
  11265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11266. // for more information.
  11267. func (c *StorelayoutclustersListCall) Fields(s ...googleapi.Field) *StorelayoutclustersListCall {
  11268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11269. return c
  11270. }
  11271. // IfNoneMatch sets the optional parameter which makes the operation
  11272. // fail if the object's ETag matches the given value. This is useful for
  11273. // getting updates only after the object has changed since the last
  11274. // request. Use googleapi.IsNotModified to check whether the response
  11275. // error from Do is the result of In-None-Match.
  11276. func (c *StorelayoutclustersListCall) IfNoneMatch(entityTag string) *StorelayoutclustersListCall {
  11277. c.ifNoneMatch_ = entityTag
  11278. return c
  11279. }
  11280. // Context sets the context to be used in this call's Do method. Any
  11281. // pending HTTP request will be aborted if the provided context is
  11282. // canceled.
  11283. func (c *StorelayoutclustersListCall) Context(ctx context.Context) *StorelayoutclustersListCall {
  11284. c.ctx_ = ctx
  11285. return c
  11286. }
  11287. // Header returns an http.Header that can be modified by the caller to
  11288. // add HTTP headers to the request.
  11289. func (c *StorelayoutclustersListCall) Header() http.Header {
  11290. if c.header_ == nil {
  11291. c.header_ = make(http.Header)
  11292. }
  11293. return c.header_
  11294. }
  11295. func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, error) {
  11296. reqHeaders := make(http.Header)
  11297. for k, v := range c.header_ {
  11298. reqHeaders[k] = v
  11299. }
  11300. reqHeaders.Set("User-Agent", c.s.userAgent())
  11301. if c.ifNoneMatch_ != "" {
  11302. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11303. }
  11304. var body io.Reader = nil
  11305. c.urlParams_.Set("alt", alt)
  11306. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters")
  11307. urls += "?" + c.urlParams_.Encode()
  11308. req, _ := http.NewRequest("GET", urls, body)
  11309. req.Header = reqHeaders
  11310. googleapi.Expand(req.URL, map[string]string{
  11311. "enterpriseId": c.enterpriseId,
  11312. "pageId": c.pageId,
  11313. })
  11314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11315. }
  11316. // Do executes the "androidenterprise.storelayoutclusters.list" call.
  11317. // Exactly one of *StoreLayoutClustersListResponse or error will be
  11318. // non-nil. Any non-2xx status code is an error. Response headers are in
  11319. // either *StoreLayoutClustersListResponse.ServerResponse.Header or (if
  11320. // a response was returned at all) in error.(*googleapi.Error).Header.
  11321. // Use googleapi.IsNotModified to check whether the returned error was
  11322. // because http.StatusNotModified was returned.
  11323. func (c *StorelayoutclustersListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutClustersListResponse, error) {
  11324. gensupport.SetOptions(c.urlParams_, opts...)
  11325. res, err := c.doRequest("json")
  11326. if res != nil && res.StatusCode == http.StatusNotModified {
  11327. if res.Body != nil {
  11328. res.Body.Close()
  11329. }
  11330. return nil, &googleapi.Error{
  11331. Code: res.StatusCode,
  11332. Header: res.Header,
  11333. }
  11334. }
  11335. if err != nil {
  11336. return nil, err
  11337. }
  11338. defer googleapi.CloseBody(res)
  11339. if err := googleapi.CheckResponse(res); err != nil {
  11340. return nil, err
  11341. }
  11342. ret := &StoreLayoutClustersListResponse{
  11343. ServerResponse: googleapi.ServerResponse{
  11344. Header: res.Header,
  11345. HTTPStatusCode: res.StatusCode,
  11346. },
  11347. }
  11348. target := &ret
  11349. if err := gensupport.DecodeResponse(target, res); err != nil {
  11350. return nil, err
  11351. }
  11352. return ret, nil
  11353. // {
  11354. // "description": "Retrieves the details of all clusters on the specified page.",
  11355. // "httpMethod": "GET",
  11356. // "id": "androidenterprise.storelayoutclusters.list",
  11357. // "parameterOrder": [
  11358. // "enterpriseId",
  11359. // "pageId"
  11360. // ],
  11361. // "parameters": {
  11362. // "enterpriseId": {
  11363. // "description": "The ID of the enterprise.",
  11364. // "location": "path",
  11365. // "required": true,
  11366. // "type": "string"
  11367. // },
  11368. // "pageId": {
  11369. // "description": "The ID of the page.",
  11370. // "location": "path",
  11371. // "required": true,
  11372. // "type": "string"
  11373. // }
  11374. // },
  11375. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters",
  11376. // "response": {
  11377. // "$ref": "StoreLayoutClustersListResponse"
  11378. // },
  11379. // "scopes": [
  11380. // "https://www.googleapis.com/auth/androidenterprise"
  11381. // ]
  11382. // }
  11383. }
  11384. // method id "androidenterprise.storelayoutclusters.patch":
  11385. type StorelayoutclustersPatchCall struct {
  11386. s *Service
  11387. enterpriseId string
  11388. pageId string
  11389. clusterId string
  11390. storecluster *StoreCluster
  11391. urlParams_ gensupport.URLParams
  11392. ctx_ context.Context
  11393. header_ http.Header
  11394. }
  11395. // Patch: Updates a cluster. This method supports patch semantics.
  11396. func (r *StorelayoutclustersService) Patch(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersPatchCall {
  11397. c := &StorelayoutclustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11398. c.enterpriseId = enterpriseId
  11399. c.pageId = pageId
  11400. c.clusterId = clusterId
  11401. c.storecluster = storecluster
  11402. return c
  11403. }
  11404. // Fields allows partial responses to be retrieved. See
  11405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11406. // for more information.
  11407. func (c *StorelayoutclustersPatchCall) Fields(s ...googleapi.Field) *StorelayoutclustersPatchCall {
  11408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11409. return c
  11410. }
  11411. // Context sets the context to be used in this call's Do method. Any
  11412. // pending HTTP request will be aborted if the provided context is
  11413. // canceled.
  11414. func (c *StorelayoutclustersPatchCall) Context(ctx context.Context) *StorelayoutclustersPatchCall {
  11415. c.ctx_ = ctx
  11416. return c
  11417. }
  11418. // Header returns an http.Header that can be modified by the caller to
  11419. // add HTTP headers to the request.
  11420. func (c *StorelayoutclustersPatchCall) Header() http.Header {
  11421. if c.header_ == nil {
  11422. c.header_ = make(http.Header)
  11423. }
  11424. return c.header_
  11425. }
  11426. func (c *StorelayoutclustersPatchCall) doRequest(alt string) (*http.Response, error) {
  11427. reqHeaders := make(http.Header)
  11428. for k, v := range c.header_ {
  11429. reqHeaders[k] = v
  11430. }
  11431. reqHeaders.Set("User-Agent", c.s.userAgent())
  11432. var body io.Reader = nil
  11433. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
  11434. if err != nil {
  11435. return nil, err
  11436. }
  11437. reqHeaders.Set("Content-Type", "application/json")
  11438. c.urlParams_.Set("alt", alt)
  11439. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11440. urls += "?" + c.urlParams_.Encode()
  11441. req, _ := http.NewRequest("PATCH", urls, body)
  11442. req.Header = reqHeaders
  11443. googleapi.Expand(req.URL, map[string]string{
  11444. "enterpriseId": c.enterpriseId,
  11445. "pageId": c.pageId,
  11446. "clusterId": c.clusterId,
  11447. })
  11448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11449. }
  11450. // Do executes the "androidenterprise.storelayoutclusters.patch" call.
  11451. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11452. // status code is an error. Response headers are in either
  11453. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11454. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11455. // to check whether the returned error was because
  11456. // http.StatusNotModified was returned.
  11457. func (c *StorelayoutclustersPatchCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11458. gensupport.SetOptions(c.urlParams_, opts...)
  11459. res, err := c.doRequest("json")
  11460. if res != nil && res.StatusCode == http.StatusNotModified {
  11461. if res.Body != nil {
  11462. res.Body.Close()
  11463. }
  11464. return nil, &googleapi.Error{
  11465. Code: res.StatusCode,
  11466. Header: res.Header,
  11467. }
  11468. }
  11469. if err != nil {
  11470. return nil, err
  11471. }
  11472. defer googleapi.CloseBody(res)
  11473. if err := googleapi.CheckResponse(res); err != nil {
  11474. return nil, err
  11475. }
  11476. ret := &StoreCluster{
  11477. ServerResponse: googleapi.ServerResponse{
  11478. Header: res.Header,
  11479. HTTPStatusCode: res.StatusCode,
  11480. },
  11481. }
  11482. target := &ret
  11483. if err := gensupport.DecodeResponse(target, res); err != nil {
  11484. return nil, err
  11485. }
  11486. return ret, nil
  11487. // {
  11488. // "description": "Updates a cluster. This method supports patch semantics.",
  11489. // "httpMethod": "PATCH",
  11490. // "id": "androidenterprise.storelayoutclusters.patch",
  11491. // "parameterOrder": [
  11492. // "enterpriseId",
  11493. // "pageId",
  11494. // "clusterId"
  11495. // ],
  11496. // "parameters": {
  11497. // "clusterId": {
  11498. // "description": "The ID of the cluster.",
  11499. // "location": "path",
  11500. // "required": true,
  11501. // "type": "string"
  11502. // },
  11503. // "enterpriseId": {
  11504. // "description": "The ID of the enterprise.",
  11505. // "location": "path",
  11506. // "required": true,
  11507. // "type": "string"
  11508. // },
  11509. // "pageId": {
  11510. // "description": "The ID of the page.",
  11511. // "location": "path",
  11512. // "required": true,
  11513. // "type": "string"
  11514. // }
  11515. // },
  11516. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11517. // "request": {
  11518. // "$ref": "StoreCluster"
  11519. // },
  11520. // "response": {
  11521. // "$ref": "StoreCluster"
  11522. // },
  11523. // "scopes": [
  11524. // "https://www.googleapis.com/auth/androidenterprise"
  11525. // ]
  11526. // }
  11527. }
  11528. // method id "androidenterprise.storelayoutclusters.update":
  11529. type StorelayoutclustersUpdateCall struct {
  11530. s *Service
  11531. enterpriseId string
  11532. pageId string
  11533. clusterId string
  11534. storecluster *StoreCluster
  11535. urlParams_ gensupport.URLParams
  11536. ctx_ context.Context
  11537. header_ http.Header
  11538. }
  11539. // Update: Updates a cluster.
  11540. func (r *StorelayoutclustersService) Update(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersUpdateCall {
  11541. c := &StorelayoutclustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11542. c.enterpriseId = enterpriseId
  11543. c.pageId = pageId
  11544. c.clusterId = clusterId
  11545. c.storecluster = storecluster
  11546. return c
  11547. }
  11548. // Fields allows partial responses to be retrieved. See
  11549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11550. // for more information.
  11551. func (c *StorelayoutclustersUpdateCall) Fields(s ...googleapi.Field) *StorelayoutclustersUpdateCall {
  11552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11553. return c
  11554. }
  11555. // Context sets the context to be used in this call's Do method. Any
  11556. // pending HTTP request will be aborted if the provided context is
  11557. // canceled.
  11558. func (c *StorelayoutclustersUpdateCall) Context(ctx context.Context) *StorelayoutclustersUpdateCall {
  11559. c.ctx_ = ctx
  11560. return c
  11561. }
  11562. // Header returns an http.Header that can be modified by the caller to
  11563. // add HTTP headers to the request.
  11564. func (c *StorelayoutclustersUpdateCall) Header() http.Header {
  11565. if c.header_ == nil {
  11566. c.header_ = make(http.Header)
  11567. }
  11568. return c.header_
  11569. }
  11570. func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  11571. reqHeaders := make(http.Header)
  11572. for k, v := range c.header_ {
  11573. reqHeaders[k] = v
  11574. }
  11575. reqHeaders.Set("User-Agent", c.s.userAgent())
  11576. var body io.Reader = nil
  11577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
  11578. if err != nil {
  11579. return nil, err
  11580. }
  11581. reqHeaders.Set("Content-Type", "application/json")
  11582. c.urlParams_.Set("alt", alt)
  11583. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
  11584. urls += "?" + c.urlParams_.Encode()
  11585. req, _ := http.NewRequest("PUT", urls, body)
  11586. req.Header = reqHeaders
  11587. googleapi.Expand(req.URL, map[string]string{
  11588. "enterpriseId": c.enterpriseId,
  11589. "pageId": c.pageId,
  11590. "clusterId": c.clusterId,
  11591. })
  11592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11593. }
  11594. // Do executes the "androidenterprise.storelayoutclusters.update" call.
  11595. // Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
  11596. // status code is an error. Response headers are in either
  11597. // *StoreCluster.ServerResponse.Header or (if a response was returned at
  11598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11599. // to check whether the returned error was because
  11600. // http.StatusNotModified was returned.
  11601. func (c *StorelayoutclustersUpdateCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
  11602. gensupport.SetOptions(c.urlParams_, opts...)
  11603. res, err := c.doRequest("json")
  11604. if res != nil && res.StatusCode == http.StatusNotModified {
  11605. if res.Body != nil {
  11606. res.Body.Close()
  11607. }
  11608. return nil, &googleapi.Error{
  11609. Code: res.StatusCode,
  11610. Header: res.Header,
  11611. }
  11612. }
  11613. if err != nil {
  11614. return nil, err
  11615. }
  11616. defer googleapi.CloseBody(res)
  11617. if err := googleapi.CheckResponse(res); err != nil {
  11618. return nil, err
  11619. }
  11620. ret := &StoreCluster{
  11621. ServerResponse: googleapi.ServerResponse{
  11622. Header: res.Header,
  11623. HTTPStatusCode: res.StatusCode,
  11624. },
  11625. }
  11626. target := &ret
  11627. if err := gensupport.DecodeResponse(target, res); err != nil {
  11628. return nil, err
  11629. }
  11630. return ret, nil
  11631. // {
  11632. // "description": "Updates a cluster.",
  11633. // "httpMethod": "PUT",
  11634. // "id": "androidenterprise.storelayoutclusters.update",
  11635. // "parameterOrder": [
  11636. // "enterpriseId",
  11637. // "pageId",
  11638. // "clusterId"
  11639. // ],
  11640. // "parameters": {
  11641. // "clusterId": {
  11642. // "description": "The ID of the cluster.",
  11643. // "location": "path",
  11644. // "required": true,
  11645. // "type": "string"
  11646. // },
  11647. // "enterpriseId": {
  11648. // "description": "The ID of the enterprise.",
  11649. // "location": "path",
  11650. // "required": true,
  11651. // "type": "string"
  11652. // },
  11653. // "pageId": {
  11654. // "description": "The ID of the page.",
  11655. // "location": "path",
  11656. // "required": true,
  11657. // "type": "string"
  11658. // }
  11659. // },
  11660. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
  11661. // "request": {
  11662. // "$ref": "StoreCluster"
  11663. // },
  11664. // "response": {
  11665. // "$ref": "StoreCluster"
  11666. // },
  11667. // "scopes": [
  11668. // "https://www.googleapis.com/auth/androidenterprise"
  11669. // ]
  11670. // }
  11671. }
  11672. // method id "androidenterprise.storelayoutpages.delete":
  11673. type StorelayoutpagesDeleteCall struct {
  11674. s *Service
  11675. enterpriseId string
  11676. pageId string
  11677. urlParams_ gensupport.URLParams
  11678. ctx_ context.Context
  11679. header_ http.Header
  11680. }
  11681. // Delete: Deletes a store page.
  11682. func (r *StorelayoutpagesService) Delete(enterpriseId string, pageId string) *StorelayoutpagesDeleteCall {
  11683. c := &StorelayoutpagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11684. c.enterpriseId = enterpriseId
  11685. c.pageId = pageId
  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 *StorelayoutpagesDeleteCall) Fields(s ...googleapi.Field) *StorelayoutpagesDeleteCall {
  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 *StorelayoutpagesDeleteCall) Context(ctx context.Context) *StorelayoutpagesDeleteCall {
  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 *StorelayoutpagesDeleteCall) Header() http.Header {
  11705. if c.header_ == nil {
  11706. c.header_ = make(http.Header)
  11707. }
  11708. return c.header_
  11709. }
  11710. func (c *StorelayoutpagesDeleteCall) 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. c.urlParams_.Set("alt", alt)
  11718. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  11719. urls += "?" + c.urlParams_.Encode()
  11720. req, _ := http.NewRequest("DELETE", urls, body)
  11721. req.Header = reqHeaders
  11722. googleapi.Expand(req.URL, map[string]string{
  11723. "enterpriseId": c.enterpriseId,
  11724. "pageId": c.pageId,
  11725. })
  11726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11727. }
  11728. // Do executes the "androidenterprise.storelayoutpages.delete" call.
  11729. func (c *StorelayoutpagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  11730. gensupport.SetOptions(c.urlParams_, opts...)
  11731. res, err := c.doRequest("json")
  11732. if err != nil {
  11733. return err
  11734. }
  11735. defer googleapi.CloseBody(res)
  11736. if err := googleapi.CheckResponse(res); err != nil {
  11737. return err
  11738. }
  11739. return nil
  11740. // {
  11741. // "description": "Deletes a store page.",
  11742. // "httpMethod": "DELETE",
  11743. // "id": "androidenterprise.storelayoutpages.delete",
  11744. // "parameterOrder": [
  11745. // "enterpriseId",
  11746. // "pageId"
  11747. // ],
  11748. // "parameters": {
  11749. // "enterpriseId": {
  11750. // "description": "The ID of the enterprise.",
  11751. // "location": "path",
  11752. // "required": true,
  11753. // "type": "string"
  11754. // },
  11755. // "pageId": {
  11756. // "description": "The ID of the page.",
  11757. // "location": "path",
  11758. // "required": true,
  11759. // "type": "string"
  11760. // }
  11761. // },
  11762. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  11763. // "scopes": [
  11764. // "https://www.googleapis.com/auth/androidenterprise"
  11765. // ]
  11766. // }
  11767. }
  11768. // method id "androidenterprise.storelayoutpages.get":
  11769. type StorelayoutpagesGetCall struct {
  11770. s *Service
  11771. enterpriseId string
  11772. pageId string
  11773. urlParams_ gensupport.URLParams
  11774. ifNoneMatch_ string
  11775. ctx_ context.Context
  11776. header_ http.Header
  11777. }
  11778. // Get: Retrieves details of a store page.
  11779. func (r *StorelayoutpagesService) Get(enterpriseId string, pageId string) *StorelayoutpagesGetCall {
  11780. c := &StorelayoutpagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11781. c.enterpriseId = enterpriseId
  11782. c.pageId = pageId
  11783. return c
  11784. }
  11785. // Fields allows partial responses to be retrieved. See
  11786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11787. // for more information.
  11788. func (c *StorelayoutpagesGetCall) Fields(s ...googleapi.Field) *StorelayoutpagesGetCall {
  11789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11790. return c
  11791. }
  11792. // IfNoneMatch sets the optional parameter which makes the operation
  11793. // fail if the object's ETag matches the given value. This is useful for
  11794. // getting updates only after the object has changed since the last
  11795. // request. Use googleapi.IsNotModified to check whether the response
  11796. // error from Do is the result of In-None-Match.
  11797. func (c *StorelayoutpagesGetCall) IfNoneMatch(entityTag string) *StorelayoutpagesGetCall {
  11798. c.ifNoneMatch_ = entityTag
  11799. return c
  11800. }
  11801. // Context sets the context to be used in this call's Do method. Any
  11802. // pending HTTP request will be aborted if the provided context is
  11803. // canceled.
  11804. func (c *StorelayoutpagesGetCall) Context(ctx context.Context) *StorelayoutpagesGetCall {
  11805. c.ctx_ = ctx
  11806. return c
  11807. }
  11808. // Header returns an http.Header that can be modified by the caller to
  11809. // add HTTP headers to the request.
  11810. func (c *StorelayoutpagesGetCall) Header() http.Header {
  11811. if c.header_ == nil {
  11812. c.header_ = make(http.Header)
  11813. }
  11814. return c.header_
  11815. }
  11816. func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) {
  11817. reqHeaders := make(http.Header)
  11818. for k, v := range c.header_ {
  11819. reqHeaders[k] = v
  11820. }
  11821. reqHeaders.Set("User-Agent", c.s.userAgent())
  11822. if c.ifNoneMatch_ != "" {
  11823. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11824. }
  11825. var body io.Reader = nil
  11826. c.urlParams_.Set("alt", alt)
  11827. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  11828. urls += "?" + c.urlParams_.Encode()
  11829. req, _ := http.NewRequest("GET", urls, body)
  11830. req.Header = reqHeaders
  11831. googleapi.Expand(req.URL, map[string]string{
  11832. "enterpriseId": c.enterpriseId,
  11833. "pageId": c.pageId,
  11834. })
  11835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11836. }
  11837. // Do executes the "androidenterprise.storelayoutpages.get" call.
  11838. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  11839. // status code is an error. Response headers are in either
  11840. // *StorePage.ServerResponse.Header or (if a response was returned at
  11841. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11842. // to check whether the returned error was because
  11843. // http.StatusNotModified was returned.
  11844. func (c *StorelayoutpagesGetCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  11845. gensupport.SetOptions(c.urlParams_, opts...)
  11846. res, err := c.doRequest("json")
  11847. if res != nil && res.StatusCode == http.StatusNotModified {
  11848. if res.Body != nil {
  11849. res.Body.Close()
  11850. }
  11851. return nil, &googleapi.Error{
  11852. Code: res.StatusCode,
  11853. Header: res.Header,
  11854. }
  11855. }
  11856. if err != nil {
  11857. return nil, err
  11858. }
  11859. defer googleapi.CloseBody(res)
  11860. if err := googleapi.CheckResponse(res); err != nil {
  11861. return nil, err
  11862. }
  11863. ret := &StorePage{
  11864. ServerResponse: googleapi.ServerResponse{
  11865. Header: res.Header,
  11866. HTTPStatusCode: res.StatusCode,
  11867. },
  11868. }
  11869. target := &ret
  11870. if err := gensupport.DecodeResponse(target, res); err != nil {
  11871. return nil, err
  11872. }
  11873. return ret, nil
  11874. // {
  11875. // "description": "Retrieves details of a store page.",
  11876. // "httpMethod": "GET",
  11877. // "id": "androidenterprise.storelayoutpages.get",
  11878. // "parameterOrder": [
  11879. // "enterpriseId",
  11880. // "pageId"
  11881. // ],
  11882. // "parameters": {
  11883. // "enterpriseId": {
  11884. // "description": "The ID of the enterprise.",
  11885. // "location": "path",
  11886. // "required": true,
  11887. // "type": "string"
  11888. // },
  11889. // "pageId": {
  11890. // "description": "The ID of the page.",
  11891. // "location": "path",
  11892. // "required": true,
  11893. // "type": "string"
  11894. // }
  11895. // },
  11896. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  11897. // "response": {
  11898. // "$ref": "StorePage"
  11899. // },
  11900. // "scopes": [
  11901. // "https://www.googleapis.com/auth/androidenterprise"
  11902. // ]
  11903. // }
  11904. }
  11905. // method id "androidenterprise.storelayoutpages.insert":
  11906. type StorelayoutpagesInsertCall struct {
  11907. s *Service
  11908. enterpriseId string
  11909. storepage *StorePage
  11910. urlParams_ gensupport.URLParams
  11911. ctx_ context.Context
  11912. header_ http.Header
  11913. }
  11914. // Insert: Inserts a new store page.
  11915. func (r *StorelayoutpagesService) Insert(enterpriseId string, storepage *StorePage) *StorelayoutpagesInsertCall {
  11916. c := &StorelayoutpagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11917. c.enterpriseId = enterpriseId
  11918. c.storepage = storepage
  11919. return c
  11920. }
  11921. // Fields allows partial responses to be retrieved. See
  11922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11923. // for more information.
  11924. func (c *StorelayoutpagesInsertCall) Fields(s ...googleapi.Field) *StorelayoutpagesInsertCall {
  11925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11926. return c
  11927. }
  11928. // Context sets the context to be used in this call's Do method. Any
  11929. // pending HTTP request will be aborted if the provided context is
  11930. // canceled.
  11931. func (c *StorelayoutpagesInsertCall) Context(ctx context.Context) *StorelayoutpagesInsertCall {
  11932. c.ctx_ = ctx
  11933. return c
  11934. }
  11935. // Header returns an http.Header that can be modified by the caller to
  11936. // add HTTP headers to the request.
  11937. func (c *StorelayoutpagesInsertCall) Header() http.Header {
  11938. if c.header_ == nil {
  11939. c.header_ = make(http.Header)
  11940. }
  11941. return c.header_
  11942. }
  11943. func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) {
  11944. reqHeaders := make(http.Header)
  11945. for k, v := range c.header_ {
  11946. reqHeaders[k] = v
  11947. }
  11948. reqHeaders.Set("User-Agent", c.s.userAgent())
  11949. var body io.Reader = nil
  11950. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
  11951. if err != nil {
  11952. return nil, err
  11953. }
  11954. reqHeaders.Set("Content-Type", "application/json")
  11955. c.urlParams_.Set("alt", alt)
  11956. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages")
  11957. urls += "?" + c.urlParams_.Encode()
  11958. req, _ := http.NewRequest("POST", urls, body)
  11959. req.Header = reqHeaders
  11960. googleapi.Expand(req.URL, map[string]string{
  11961. "enterpriseId": c.enterpriseId,
  11962. })
  11963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11964. }
  11965. // Do executes the "androidenterprise.storelayoutpages.insert" call.
  11966. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  11967. // status code is an error. Response headers are in either
  11968. // *StorePage.ServerResponse.Header or (if a response was returned at
  11969. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11970. // to check whether the returned error was because
  11971. // http.StatusNotModified was returned.
  11972. func (c *StorelayoutpagesInsertCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  11973. gensupport.SetOptions(c.urlParams_, opts...)
  11974. res, err := c.doRequest("json")
  11975. if res != nil && res.StatusCode == http.StatusNotModified {
  11976. if res.Body != nil {
  11977. res.Body.Close()
  11978. }
  11979. return nil, &googleapi.Error{
  11980. Code: res.StatusCode,
  11981. Header: res.Header,
  11982. }
  11983. }
  11984. if err != nil {
  11985. return nil, err
  11986. }
  11987. defer googleapi.CloseBody(res)
  11988. if err := googleapi.CheckResponse(res); err != nil {
  11989. return nil, err
  11990. }
  11991. ret := &StorePage{
  11992. ServerResponse: googleapi.ServerResponse{
  11993. Header: res.Header,
  11994. HTTPStatusCode: res.StatusCode,
  11995. },
  11996. }
  11997. target := &ret
  11998. if err := gensupport.DecodeResponse(target, res); err != nil {
  11999. return nil, err
  12000. }
  12001. return ret, nil
  12002. // {
  12003. // "description": "Inserts a new store page.",
  12004. // "httpMethod": "POST",
  12005. // "id": "androidenterprise.storelayoutpages.insert",
  12006. // "parameterOrder": [
  12007. // "enterpriseId"
  12008. // ],
  12009. // "parameters": {
  12010. // "enterpriseId": {
  12011. // "description": "The ID of the enterprise.",
  12012. // "location": "path",
  12013. // "required": true,
  12014. // "type": "string"
  12015. // }
  12016. // },
  12017. // "path": "enterprises/{enterpriseId}/storeLayout/pages",
  12018. // "request": {
  12019. // "$ref": "StorePage"
  12020. // },
  12021. // "response": {
  12022. // "$ref": "StorePage"
  12023. // },
  12024. // "scopes": [
  12025. // "https://www.googleapis.com/auth/androidenterprise"
  12026. // ]
  12027. // }
  12028. }
  12029. // method id "androidenterprise.storelayoutpages.list":
  12030. type StorelayoutpagesListCall struct {
  12031. s *Service
  12032. enterpriseId string
  12033. urlParams_ gensupport.URLParams
  12034. ifNoneMatch_ string
  12035. ctx_ context.Context
  12036. header_ http.Header
  12037. }
  12038. // List: Retrieves the details of all pages in the store.
  12039. func (r *StorelayoutpagesService) List(enterpriseId string) *StorelayoutpagesListCall {
  12040. c := &StorelayoutpagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12041. c.enterpriseId = enterpriseId
  12042. return c
  12043. }
  12044. // Fields allows partial responses to be retrieved. See
  12045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12046. // for more information.
  12047. func (c *StorelayoutpagesListCall) Fields(s ...googleapi.Field) *StorelayoutpagesListCall {
  12048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12049. return c
  12050. }
  12051. // IfNoneMatch sets the optional parameter which makes the operation
  12052. // fail if the object's ETag matches the given value. This is useful for
  12053. // getting updates only after the object has changed since the last
  12054. // request. Use googleapi.IsNotModified to check whether the response
  12055. // error from Do is the result of In-None-Match.
  12056. func (c *StorelayoutpagesListCall) IfNoneMatch(entityTag string) *StorelayoutpagesListCall {
  12057. c.ifNoneMatch_ = entityTag
  12058. return c
  12059. }
  12060. // Context sets the context to be used in this call's Do method. Any
  12061. // pending HTTP request will be aborted if the provided context is
  12062. // canceled.
  12063. func (c *StorelayoutpagesListCall) Context(ctx context.Context) *StorelayoutpagesListCall {
  12064. c.ctx_ = ctx
  12065. return c
  12066. }
  12067. // Header returns an http.Header that can be modified by the caller to
  12068. // add HTTP headers to the request.
  12069. func (c *StorelayoutpagesListCall) Header() http.Header {
  12070. if c.header_ == nil {
  12071. c.header_ = make(http.Header)
  12072. }
  12073. return c.header_
  12074. }
  12075. func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) {
  12076. reqHeaders := make(http.Header)
  12077. for k, v := range c.header_ {
  12078. reqHeaders[k] = v
  12079. }
  12080. reqHeaders.Set("User-Agent", c.s.userAgent())
  12081. if c.ifNoneMatch_ != "" {
  12082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12083. }
  12084. var body io.Reader = nil
  12085. c.urlParams_.Set("alt", alt)
  12086. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages")
  12087. urls += "?" + c.urlParams_.Encode()
  12088. req, _ := http.NewRequest("GET", urls, body)
  12089. req.Header = reqHeaders
  12090. googleapi.Expand(req.URL, map[string]string{
  12091. "enterpriseId": c.enterpriseId,
  12092. })
  12093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12094. }
  12095. // Do executes the "androidenterprise.storelayoutpages.list" call.
  12096. // Exactly one of *StoreLayoutPagesListResponse or error will be
  12097. // non-nil. Any non-2xx status code is an error. Response headers are in
  12098. // either *StoreLayoutPagesListResponse.ServerResponse.Header or (if a
  12099. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12100. // googleapi.IsNotModified to check whether the returned error was
  12101. // because http.StatusNotModified was returned.
  12102. func (c *StorelayoutpagesListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutPagesListResponse, error) {
  12103. gensupport.SetOptions(c.urlParams_, opts...)
  12104. res, err := c.doRequest("json")
  12105. if res != nil && res.StatusCode == http.StatusNotModified {
  12106. if res.Body != nil {
  12107. res.Body.Close()
  12108. }
  12109. return nil, &googleapi.Error{
  12110. Code: res.StatusCode,
  12111. Header: res.Header,
  12112. }
  12113. }
  12114. if err != nil {
  12115. return nil, err
  12116. }
  12117. defer googleapi.CloseBody(res)
  12118. if err := googleapi.CheckResponse(res); err != nil {
  12119. return nil, err
  12120. }
  12121. ret := &StoreLayoutPagesListResponse{
  12122. ServerResponse: googleapi.ServerResponse{
  12123. Header: res.Header,
  12124. HTTPStatusCode: res.StatusCode,
  12125. },
  12126. }
  12127. target := &ret
  12128. if err := gensupport.DecodeResponse(target, res); err != nil {
  12129. return nil, err
  12130. }
  12131. return ret, nil
  12132. // {
  12133. // "description": "Retrieves the details of all pages in the store.",
  12134. // "httpMethod": "GET",
  12135. // "id": "androidenterprise.storelayoutpages.list",
  12136. // "parameterOrder": [
  12137. // "enterpriseId"
  12138. // ],
  12139. // "parameters": {
  12140. // "enterpriseId": {
  12141. // "description": "The ID of the enterprise.",
  12142. // "location": "path",
  12143. // "required": true,
  12144. // "type": "string"
  12145. // }
  12146. // },
  12147. // "path": "enterprises/{enterpriseId}/storeLayout/pages",
  12148. // "response": {
  12149. // "$ref": "StoreLayoutPagesListResponse"
  12150. // },
  12151. // "scopes": [
  12152. // "https://www.googleapis.com/auth/androidenterprise"
  12153. // ]
  12154. // }
  12155. }
  12156. // method id "androidenterprise.storelayoutpages.patch":
  12157. type StorelayoutpagesPatchCall struct {
  12158. s *Service
  12159. enterpriseId string
  12160. pageId string
  12161. storepage *StorePage
  12162. urlParams_ gensupport.URLParams
  12163. ctx_ context.Context
  12164. header_ http.Header
  12165. }
  12166. // Patch: Updates the content of a store page. This method supports
  12167. // patch semantics.
  12168. func (r *StorelayoutpagesService) Patch(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesPatchCall {
  12169. c := &StorelayoutpagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12170. c.enterpriseId = enterpriseId
  12171. c.pageId = pageId
  12172. c.storepage = storepage
  12173. return c
  12174. }
  12175. // Fields allows partial responses to be retrieved. See
  12176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12177. // for more information.
  12178. func (c *StorelayoutpagesPatchCall) Fields(s ...googleapi.Field) *StorelayoutpagesPatchCall {
  12179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12180. return c
  12181. }
  12182. // Context sets the context to be used in this call's Do method. Any
  12183. // pending HTTP request will be aborted if the provided context is
  12184. // canceled.
  12185. func (c *StorelayoutpagesPatchCall) Context(ctx context.Context) *StorelayoutpagesPatchCall {
  12186. c.ctx_ = ctx
  12187. return c
  12188. }
  12189. // Header returns an http.Header that can be modified by the caller to
  12190. // add HTTP headers to the request.
  12191. func (c *StorelayoutpagesPatchCall) Header() http.Header {
  12192. if c.header_ == nil {
  12193. c.header_ = make(http.Header)
  12194. }
  12195. return c.header_
  12196. }
  12197. func (c *StorelayoutpagesPatchCall) doRequest(alt string) (*http.Response, error) {
  12198. reqHeaders := make(http.Header)
  12199. for k, v := range c.header_ {
  12200. reqHeaders[k] = v
  12201. }
  12202. reqHeaders.Set("User-Agent", c.s.userAgent())
  12203. var body io.Reader = nil
  12204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
  12205. if err != nil {
  12206. return nil, err
  12207. }
  12208. reqHeaders.Set("Content-Type", "application/json")
  12209. c.urlParams_.Set("alt", alt)
  12210. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  12211. urls += "?" + c.urlParams_.Encode()
  12212. req, _ := http.NewRequest("PATCH", urls, body)
  12213. req.Header = reqHeaders
  12214. googleapi.Expand(req.URL, map[string]string{
  12215. "enterpriseId": c.enterpriseId,
  12216. "pageId": c.pageId,
  12217. })
  12218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12219. }
  12220. // Do executes the "androidenterprise.storelayoutpages.patch" call.
  12221. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  12222. // status code is an error. Response headers are in either
  12223. // *StorePage.ServerResponse.Header or (if a response was returned at
  12224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12225. // to check whether the returned error was because
  12226. // http.StatusNotModified was returned.
  12227. func (c *StorelayoutpagesPatchCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  12228. gensupport.SetOptions(c.urlParams_, opts...)
  12229. res, err := c.doRequest("json")
  12230. if res != nil && res.StatusCode == http.StatusNotModified {
  12231. if res.Body != nil {
  12232. res.Body.Close()
  12233. }
  12234. return nil, &googleapi.Error{
  12235. Code: res.StatusCode,
  12236. Header: res.Header,
  12237. }
  12238. }
  12239. if err != nil {
  12240. return nil, err
  12241. }
  12242. defer googleapi.CloseBody(res)
  12243. if err := googleapi.CheckResponse(res); err != nil {
  12244. return nil, err
  12245. }
  12246. ret := &StorePage{
  12247. ServerResponse: googleapi.ServerResponse{
  12248. Header: res.Header,
  12249. HTTPStatusCode: res.StatusCode,
  12250. },
  12251. }
  12252. target := &ret
  12253. if err := gensupport.DecodeResponse(target, res); err != nil {
  12254. return nil, err
  12255. }
  12256. return ret, nil
  12257. // {
  12258. // "description": "Updates the content of a store page. This method supports patch semantics.",
  12259. // "httpMethod": "PATCH",
  12260. // "id": "androidenterprise.storelayoutpages.patch",
  12261. // "parameterOrder": [
  12262. // "enterpriseId",
  12263. // "pageId"
  12264. // ],
  12265. // "parameters": {
  12266. // "enterpriseId": {
  12267. // "description": "The ID of the enterprise.",
  12268. // "location": "path",
  12269. // "required": true,
  12270. // "type": "string"
  12271. // },
  12272. // "pageId": {
  12273. // "description": "The ID of the page.",
  12274. // "location": "path",
  12275. // "required": true,
  12276. // "type": "string"
  12277. // }
  12278. // },
  12279. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  12280. // "request": {
  12281. // "$ref": "StorePage"
  12282. // },
  12283. // "response": {
  12284. // "$ref": "StorePage"
  12285. // },
  12286. // "scopes": [
  12287. // "https://www.googleapis.com/auth/androidenterprise"
  12288. // ]
  12289. // }
  12290. }
  12291. // method id "androidenterprise.storelayoutpages.update":
  12292. type StorelayoutpagesUpdateCall struct {
  12293. s *Service
  12294. enterpriseId string
  12295. pageId string
  12296. storepage *StorePage
  12297. urlParams_ gensupport.URLParams
  12298. ctx_ context.Context
  12299. header_ http.Header
  12300. }
  12301. // Update: Updates the content of a store page.
  12302. func (r *StorelayoutpagesService) Update(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesUpdateCall {
  12303. c := &StorelayoutpagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12304. c.enterpriseId = enterpriseId
  12305. c.pageId = pageId
  12306. c.storepage = storepage
  12307. return c
  12308. }
  12309. // Fields allows partial responses to be retrieved. See
  12310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12311. // for more information.
  12312. func (c *StorelayoutpagesUpdateCall) Fields(s ...googleapi.Field) *StorelayoutpagesUpdateCall {
  12313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12314. return c
  12315. }
  12316. // Context sets the context to be used in this call's Do method. Any
  12317. // pending HTTP request will be aborted if the provided context is
  12318. // canceled.
  12319. func (c *StorelayoutpagesUpdateCall) Context(ctx context.Context) *StorelayoutpagesUpdateCall {
  12320. c.ctx_ = ctx
  12321. return c
  12322. }
  12323. // Header returns an http.Header that can be modified by the caller to
  12324. // add HTTP headers to the request.
  12325. func (c *StorelayoutpagesUpdateCall) Header() http.Header {
  12326. if c.header_ == nil {
  12327. c.header_ = make(http.Header)
  12328. }
  12329. return c.header_
  12330. }
  12331. func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12332. reqHeaders := make(http.Header)
  12333. for k, v := range c.header_ {
  12334. reqHeaders[k] = v
  12335. }
  12336. reqHeaders.Set("User-Agent", c.s.userAgent())
  12337. var body io.Reader = nil
  12338. body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
  12339. if err != nil {
  12340. return nil, err
  12341. }
  12342. reqHeaders.Set("Content-Type", "application/json")
  12343. c.urlParams_.Set("alt", alt)
  12344. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
  12345. urls += "?" + c.urlParams_.Encode()
  12346. req, _ := http.NewRequest("PUT", urls, body)
  12347. req.Header = reqHeaders
  12348. googleapi.Expand(req.URL, map[string]string{
  12349. "enterpriseId": c.enterpriseId,
  12350. "pageId": c.pageId,
  12351. })
  12352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12353. }
  12354. // Do executes the "androidenterprise.storelayoutpages.update" call.
  12355. // Exactly one of *StorePage or error will be non-nil. Any non-2xx
  12356. // status code is an error. Response headers are in either
  12357. // *StorePage.ServerResponse.Header or (if a response was returned at
  12358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12359. // to check whether the returned error was because
  12360. // http.StatusNotModified was returned.
  12361. func (c *StorelayoutpagesUpdateCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
  12362. gensupport.SetOptions(c.urlParams_, opts...)
  12363. res, err := c.doRequest("json")
  12364. if res != nil && res.StatusCode == http.StatusNotModified {
  12365. if res.Body != nil {
  12366. res.Body.Close()
  12367. }
  12368. return nil, &googleapi.Error{
  12369. Code: res.StatusCode,
  12370. Header: res.Header,
  12371. }
  12372. }
  12373. if err != nil {
  12374. return nil, err
  12375. }
  12376. defer googleapi.CloseBody(res)
  12377. if err := googleapi.CheckResponse(res); err != nil {
  12378. return nil, err
  12379. }
  12380. ret := &StorePage{
  12381. ServerResponse: googleapi.ServerResponse{
  12382. Header: res.Header,
  12383. HTTPStatusCode: res.StatusCode,
  12384. },
  12385. }
  12386. target := &ret
  12387. if err := gensupport.DecodeResponse(target, res); err != nil {
  12388. return nil, err
  12389. }
  12390. return ret, nil
  12391. // {
  12392. // "description": "Updates the content of a store page.",
  12393. // "httpMethod": "PUT",
  12394. // "id": "androidenterprise.storelayoutpages.update",
  12395. // "parameterOrder": [
  12396. // "enterpriseId",
  12397. // "pageId"
  12398. // ],
  12399. // "parameters": {
  12400. // "enterpriseId": {
  12401. // "description": "The ID of the enterprise.",
  12402. // "location": "path",
  12403. // "required": true,
  12404. // "type": "string"
  12405. // },
  12406. // "pageId": {
  12407. // "description": "The ID of the page.",
  12408. // "location": "path",
  12409. // "required": true,
  12410. // "type": "string"
  12411. // }
  12412. // },
  12413. // "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
  12414. // "request": {
  12415. // "$ref": "StorePage"
  12416. // },
  12417. // "response": {
  12418. // "$ref": "StorePage"
  12419. // },
  12420. // "scopes": [
  12421. // "https://www.googleapis.com/auth/androidenterprise"
  12422. // ]
  12423. // }
  12424. }
  12425. // method id "androidenterprise.users.delete":
  12426. type UsersDeleteCall struct {
  12427. s *Service
  12428. enterpriseId string
  12429. userId string
  12430. urlParams_ gensupport.URLParams
  12431. ctx_ context.Context
  12432. header_ http.Header
  12433. }
  12434. // Delete: Deleted an EMM-managed user.
  12435. func (r *UsersService) Delete(enterpriseId string, userId string) *UsersDeleteCall {
  12436. c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12437. c.enterpriseId = enterpriseId
  12438. c.userId = userId
  12439. return c
  12440. }
  12441. // Fields allows partial responses to be retrieved. See
  12442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12443. // for more information.
  12444. func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
  12445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12446. return c
  12447. }
  12448. // Context sets the context to be used in this call's Do method. Any
  12449. // pending HTTP request will be aborted if the provided context is
  12450. // canceled.
  12451. func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
  12452. c.ctx_ = ctx
  12453. return c
  12454. }
  12455. // Header returns an http.Header that can be modified by the caller to
  12456. // add HTTP headers to the request.
  12457. func (c *UsersDeleteCall) Header() http.Header {
  12458. if c.header_ == nil {
  12459. c.header_ = make(http.Header)
  12460. }
  12461. return c.header_
  12462. }
  12463. func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
  12464. reqHeaders := make(http.Header)
  12465. for k, v := range c.header_ {
  12466. reqHeaders[k] = v
  12467. }
  12468. reqHeaders.Set("User-Agent", c.s.userAgent())
  12469. var body io.Reader = nil
  12470. c.urlParams_.Set("alt", alt)
  12471. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  12472. urls += "?" + c.urlParams_.Encode()
  12473. req, _ := http.NewRequest("DELETE", urls, body)
  12474. req.Header = reqHeaders
  12475. googleapi.Expand(req.URL, map[string]string{
  12476. "enterpriseId": c.enterpriseId,
  12477. "userId": c.userId,
  12478. })
  12479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12480. }
  12481. // Do executes the "androidenterprise.users.delete" call.
  12482. func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) error {
  12483. gensupport.SetOptions(c.urlParams_, opts...)
  12484. res, err := c.doRequest("json")
  12485. if err != nil {
  12486. return err
  12487. }
  12488. defer googleapi.CloseBody(res)
  12489. if err := googleapi.CheckResponse(res); err != nil {
  12490. return err
  12491. }
  12492. return nil
  12493. // {
  12494. // "description": "Deleted an EMM-managed user.",
  12495. // "httpMethod": "DELETE",
  12496. // "id": "androidenterprise.users.delete",
  12497. // "parameterOrder": [
  12498. // "enterpriseId",
  12499. // "userId"
  12500. // ],
  12501. // "parameters": {
  12502. // "enterpriseId": {
  12503. // "description": "The ID of the enterprise.",
  12504. // "location": "path",
  12505. // "required": true,
  12506. // "type": "string"
  12507. // },
  12508. // "userId": {
  12509. // "description": "The ID of the user.",
  12510. // "location": "path",
  12511. // "required": true,
  12512. // "type": "string"
  12513. // }
  12514. // },
  12515. // "path": "enterprises/{enterpriseId}/users/{userId}",
  12516. // "scopes": [
  12517. // "https://www.googleapis.com/auth/androidenterprise"
  12518. // ]
  12519. // }
  12520. }
  12521. // method id "androidenterprise.users.generateAuthenticationToken":
  12522. type UsersGenerateAuthenticationTokenCall struct {
  12523. s *Service
  12524. enterpriseId string
  12525. userId string
  12526. urlParams_ gensupport.URLParams
  12527. ctx_ context.Context
  12528. header_ http.Header
  12529. }
  12530. // GenerateAuthenticationToken: Generates an authentication token which
  12531. // the device policy client can use to provision the given EMM-managed
  12532. // user account on a device. The generated token is single-use and
  12533. // expires after a few minutes.
  12534. //
  12535. // This call only works with EMM-managed accounts.
  12536. func (r *UsersService) GenerateAuthenticationToken(enterpriseId string, userId string) *UsersGenerateAuthenticationTokenCall {
  12537. c := &UsersGenerateAuthenticationTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12538. c.enterpriseId = enterpriseId
  12539. c.userId = userId
  12540. return c
  12541. }
  12542. // Fields allows partial responses to be retrieved. See
  12543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12544. // for more information.
  12545. func (c *UsersGenerateAuthenticationTokenCall) Fields(s ...googleapi.Field) *UsersGenerateAuthenticationTokenCall {
  12546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12547. return c
  12548. }
  12549. // Context sets the context to be used in this call's Do method. Any
  12550. // pending HTTP request will be aborted if the provided context is
  12551. // canceled.
  12552. func (c *UsersGenerateAuthenticationTokenCall) Context(ctx context.Context) *UsersGenerateAuthenticationTokenCall {
  12553. c.ctx_ = ctx
  12554. return c
  12555. }
  12556. // Header returns an http.Header that can be modified by the caller to
  12557. // add HTTP headers to the request.
  12558. func (c *UsersGenerateAuthenticationTokenCall) Header() http.Header {
  12559. if c.header_ == nil {
  12560. c.header_ = make(http.Header)
  12561. }
  12562. return c.header_
  12563. }
  12564. func (c *UsersGenerateAuthenticationTokenCall) doRequest(alt string) (*http.Response, error) {
  12565. reqHeaders := make(http.Header)
  12566. for k, v := range c.header_ {
  12567. reqHeaders[k] = v
  12568. }
  12569. reqHeaders.Set("User-Agent", c.s.userAgent())
  12570. var body io.Reader = nil
  12571. c.urlParams_.Set("alt", alt)
  12572. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/authenticationToken")
  12573. urls += "?" + c.urlParams_.Encode()
  12574. req, _ := http.NewRequest("POST", urls, body)
  12575. req.Header = reqHeaders
  12576. googleapi.Expand(req.URL, map[string]string{
  12577. "enterpriseId": c.enterpriseId,
  12578. "userId": c.userId,
  12579. })
  12580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12581. }
  12582. // Do executes the "androidenterprise.users.generateAuthenticationToken" call.
  12583. // Exactly one of *AuthenticationToken or error will be non-nil. Any
  12584. // non-2xx status code is an error. Response headers are in either
  12585. // *AuthenticationToken.ServerResponse.Header or (if a response was
  12586. // returned at all) in error.(*googleapi.Error).Header. Use
  12587. // googleapi.IsNotModified to check whether the returned error was
  12588. // because http.StatusNotModified was returned.
  12589. func (c *UsersGenerateAuthenticationTokenCall) Do(opts ...googleapi.CallOption) (*AuthenticationToken, error) {
  12590. gensupport.SetOptions(c.urlParams_, opts...)
  12591. res, err := c.doRequest("json")
  12592. if res != nil && res.StatusCode == http.StatusNotModified {
  12593. if res.Body != nil {
  12594. res.Body.Close()
  12595. }
  12596. return nil, &googleapi.Error{
  12597. Code: res.StatusCode,
  12598. Header: res.Header,
  12599. }
  12600. }
  12601. if err != nil {
  12602. return nil, err
  12603. }
  12604. defer googleapi.CloseBody(res)
  12605. if err := googleapi.CheckResponse(res); err != nil {
  12606. return nil, err
  12607. }
  12608. ret := &AuthenticationToken{
  12609. ServerResponse: googleapi.ServerResponse{
  12610. Header: res.Header,
  12611. HTTPStatusCode: res.StatusCode,
  12612. },
  12613. }
  12614. target := &ret
  12615. if err := gensupport.DecodeResponse(target, res); err != nil {
  12616. return nil, err
  12617. }
  12618. return ret, nil
  12619. // {
  12620. // "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\nThis call only works with EMM-managed accounts.",
  12621. // "httpMethod": "POST",
  12622. // "id": "androidenterprise.users.generateAuthenticationToken",
  12623. // "parameterOrder": [
  12624. // "enterpriseId",
  12625. // "userId"
  12626. // ],
  12627. // "parameters": {
  12628. // "enterpriseId": {
  12629. // "description": "The ID of the enterprise.",
  12630. // "location": "path",
  12631. // "required": true,
  12632. // "type": "string"
  12633. // },
  12634. // "userId": {
  12635. // "description": "The ID of the user.",
  12636. // "location": "path",
  12637. // "required": true,
  12638. // "type": "string"
  12639. // }
  12640. // },
  12641. // "path": "enterprises/{enterpriseId}/users/{userId}/authenticationToken",
  12642. // "response": {
  12643. // "$ref": "AuthenticationToken"
  12644. // },
  12645. // "scopes": [
  12646. // "https://www.googleapis.com/auth/androidenterprise"
  12647. // ]
  12648. // }
  12649. }
  12650. // method id "androidenterprise.users.generateToken":
  12651. type UsersGenerateTokenCall struct {
  12652. s *Service
  12653. enterpriseId string
  12654. userId string
  12655. urlParams_ gensupport.URLParams
  12656. ctx_ context.Context
  12657. header_ http.Header
  12658. }
  12659. // GenerateToken: Generates a token (activation code) to allow this user
  12660. // to configure their managed account in the Android Setup Wizard.
  12661. // Revokes any previously generated token.
  12662. //
  12663. // This call only works with Google managed accounts.
  12664. func (r *UsersService) GenerateToken(enterpriseId string, userId string) *UsersGenerateTokenCall {
  12665. c := &UsersGenerateTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12666. c.enterpriseId = enterpriseId
  12667. c.userId = userId
  12668. return c
  12669. }
  12670. // Fields allows partial responses to be retrieved. See
  12671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12672. // for more information.
  12673. func (c *UsersGenerateTokenCall) Fields(s ...googleapi.Field) *UsersGenerateTokenCall {
  12674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12675. return c
  12676. }
  12677. // Context sets the context to be used in this call's Do method. Any
  12678. // pending HTTP request will be aborted if the provided context is
  12679. // canceled.
  12680. func (c *UsersGenerateTokenCall) Context(ctx context.Context) *UsersGenerateTokenCall {
  12681. c.ctx_ = ctx
  12682. return c
  12683. }
  12684. // Header returns an http.Header that can be modified by the caller to
  12685. // add HTTP headers to the request.
  12686. func (c *UsersGenerateTokenCall) Header() http.Header {
  12687. if c.header_ == nil {
  12688. c.header_ = make(http.Header)
  12689. }
  12690. return c.header_
  12691. }
  12692. func (c *UsersGenerateTokenCall) doRequest(alt string) (*http.Response, error) {
  12693. reqHeaders := make(http.Header)
  12694. for k, v := range c.header_ {
  12695. reqHeaders[k] = v
  12696. }
  12697. reqHeaders.Set("User-Agent", c.s.userAgent())
  12698. var body io.Reader = nil
  12699. c.urlParams_.Set("alt", alt)
  12700. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
  12701. urls += "?" + c.urlParams_.Encode()
  12702. req, _ := http.NewRequest("POST", urls, body)
  12703. req.Header = reqHeaders
  12704. googleapi.Expand(req.URL, map[string]string{
  12705. "enterpriseId": c.enterpriseId,
  12706. "userId": c.userId,
  12707. })
  12708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12709. }
  12710. // Do executes the "androidenterprise.users.generateToken" call.
  12711. // Exactly one of *UserToken or error will be non-nil. Any non-2xx
  12712. // status code is an error. Response headers are in either
  12713. // *UserToken.ServerResponse.Header or (if a response was returned at
  12714. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12715. // to check whether the returned error was because
  12716. // http.StatusNotModified was returned.
  12717. func (c *UsersGenerateTokenCall) Do(opts ...googleapi.CallOption) (*UserToken, error) {
  12718. gensupport.SetOptions(c.urlParams_, opts...)
  12719. res, err := c.doRequest("json")
  12720. if res != nil && res.StatusCode == http.StatusNotModified {
  12721. if res.Body != nil {
  12722. res.Body.Close()
  12723. }
  12724. return nil, &googleapi.Error{
  12725. Code: res.StatusCode,
  12726. Header: res.Header,
  12727. }
  12728. }
  12729. if err != nil {
  12730. return nil, err
  12731. }
  12732. defer googleapi.CloseBody(res)
  12733. if err := googleapi.CheckResponse(res); err != nil {
  12734. return nil, err
  12735. }
  12736. ret := &UserToken{
  12737. ServerResponse: googleapi.ServerResponse{
  12738. Header: res.Header,
  12739. HTTPStatusCode: res.StatusCode,
  12740. },
  12741. }
  12742. target := &ret
  12743. if err := gensupport.DecodeResponse(target, res); err != nil {
  12744. return nil, err
  12745. }
  12746. return ret, nil
  12747. // {
  12748. // "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.",
  12749. // "httpMethod": "POST",
  12750. // "id": "androidenterprise.users.generateToken",
  12751. // "parameterOrder": [
  12752. // "enterpriseId",
  12753. // "userId"
  12754. // ],
  12755. // "parameters": {
  12756. // "enterpriseId": {
  12757. // "description": "The ID of the enterprise.",
  12758. // "location": "path",
  12759. // "required": true,
  12760. // "type": "string"
  12761. // },
  12762. // "userId": {
  12763. // "description": "The ID of the user.",
  12764. // "location": "path",
  12765. // "required": true,
  12766. // "type": "string"
  12767. // }
  12768. // },
  12769. // "path": "enterprises/{enterpriseId}/users/{userId}/token",
  12770. // "response": {
  12771. // "$ref": "UserToken"
  12772. // },
  12773. // "scopes": [
  12774. // "https://www.googleapis.com/auth/androidenterprise"
  12775. // ]
  12776. // }
  12777. }
  12778. // method id "androidenterprise.users.get":
  12779. type UsersGetCall struct {
  12780. s *Service
  12781. enterpriseId string
  12782. userId string
  12783. urlParams_ gensupport.URLParams
  12784. ifNoneMatch_ string
  12785. ctx_ context.Context
  12786. header_ http.Header
  12787. }
  12788. // Get: Retrieves a user's details.
  12789. func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall {
  12790. c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12791. c.enterpriseId = enterpriseId
  12792. c.userId = userId
  12793. return c
  12794. }
  12795. // Fields allows partial responses to be retrieved. See
  12796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12797. // for more information.
  12798. func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
  12799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12800. return c
  12801. }
  12802. // IfNoneMatch sets the optional parameter which makes the operation
  12803. // fail if the object's ETag matches the given value. This is useful for
  12804. // getting updates only after the object has changed since the last
  12805. // request. Use googleapi.IsNotModified to check whether the response
  12806. // error from Do is the result of In-None-Match.
  12807. func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
  12808. c.ifNoneMatch_ = entityTag
  12809. return c
  12810. }
  12811. // Context sets the context to be used in this call's Do method. Any
  12812. // pending HTTP request will be aborted if the provided context is
  12813. // canceled.
  12814. func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
  12815. c.ctx_ = ctx
  12816. return c
  12817. }
  12818. // Header returns an http.Header that can be modified by the caller to
  12819. // add HTTP headers to the request.
  12820. func (c *UsersGetCall) Header() http.Header {
  12821. if c.header_ == nil {
  12822. c.header_ = make(http.Header)
  12823. }
  12824. return c.header_
  12825. }
  12826. func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
  12827. reqHeaders := make(http.Header)
  12828. for k, v := range c.header_ {
  12829. reqHeaders[k] = v
  12830. }
  12831. reqHeaders.Set("User-Agent", c.s.userAgent())
  12832. if c.ifNoneMatch_ != "" {
  12833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12834. }
  12835. var body io.Reader = nil
  12836. c.urlParams_.Set("alt", alt)
  12837. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  12838. urls += "?" + c.urlParams_.Encode()
  12839. req, _ := http.NewRequest("GET", urls, body)
  12840. req.Header = reqHeaders
  12841. googleapi.Expand(req.URL, map[string]string{
  12842. "enterpriseId": c.enterpriseId,
  12843. "userId": c.userId,
  12844. })
  12845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12846. }
  12847. // Do executes the "androidenterprise.users.get" call.
  12848. // Exactly one of *User or error will be non-nil. Any non-2xx status
  12849. // code is an error. Response headers are in either
  12850. // *User.ServerResponse.Header or (if a response was returned at all) in
  12851. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12852. // whether the returned error was because http.StatusNotModified was
  12853. // returned.
  12854. func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
  12855. gensupport.SetOptions(c.urlParams_, opts...)
  12856. res, err := c.doRequest("json")
  12857. if res != nil && res.StatusCode == http.StatusNotModified {
  12858. if res.Body != nil {
  12859. res.Body.Close()
  12860. }
  12861. return nil, &googleapi.Error{
  12862. Code: res.StatusCode,
  12863. Header: res.Header,
  12864. }
  12865. }
  12866. if err != nil {
  12867. return nil, err
  12868. }
  12869. defer googleapi.CloseBody(res)
  12870. if err := googleapi.CheckResponse(res); err != nil {
  12871. return nil, err
  12872. }
  12873. ret := &User{
  12874. ServerResponse: googleapi.ServerResponse{
  12875. Header: res.Header,
  12876. HTTPStatusCode: res.StatusCode,
  12877. },
  12878. }
  12879. target := &ret
  12880. if err := gensupport.DecodeResponse(target, res); err != nil {
  12881. return nil, err
  12882. }
  12883. return ret, nil
  12884. // {
  12885. // "description": "Retrieves a user's details.",
  12886. // "httpMethod": "GET",
  12887. // "id": "androidenterprise.users.get",
  12888. // "parameterOrder": [
  12889. // "enterpriseId",
  12890. // "userId"
  12891. // ],
  12892. // "parameters": {
  12893. // "enterpriseId": {
  12894. // "description": "The ID of the enterprise.",
  12895. // "location": "path",
  12896. // "required": true,
  12897. // "type": "string"
  12898. // },
  12899. // "userId": {
  12900. // "description": "The ID of the user.",
  12901. // "location": "path",
  12902. // "required": true,
  12903. // "type": "string"
  12904. // }
  12905. // },
  12906. // "path": "enterprises/{enterpriseId}/users/{userId}",
  12907. // "response": {
  12908. // "$ref": "User"
  12909. // },
  12910. // "scopes": [
  12911. // "https://www.googleapis.com/auth/androidenterprise"
  12912. // ]
  12913. // }
  12914. }
  12915. // method id "androidenterprise.users.getAvailableProductSet":
  12916. type UsersGetAvailableProductSetCall struct {
  12917. s *Service
  12918. enterpriseId string
  12919. userId string
  12920. urlParams_ gensupport.URLParams
  12921. ifNoneMatch_ string
  12922. ctx_ context.Context
  12923. header_ http.Header
  12924. }
  12925. // GetAvailableProductSet: Retrieves the set of products a user is
  12926. // entitled to access.
  12927. func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall {
  12928. c := &UsersGetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12929. c.enterpriseId = enterpriseId
  12930. c.userId = userId
  12931. return c
  12932. }
  12933. // Fields allows partial responses to be retrieved. See
  12934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12935. // for more information.
  12936. func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall {
  12937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12938. return c
  12939. }
  12940. // IfNoneMatch sets the optional parameter which makes the operation
  12941. // fail if the object's ETag matches the given value. This is useful for
  12942. // getting updates only after the object has changed since the last
  12943. // request. Use googleapi.IsNotModified to check whether the response
  12944. // error from Do is the result of In-None-Match.
  12945. func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall {
  12946. c.ifNoneMatch_ = entityTag
  12947. return c
  12948. }
  12949. // Context sets the context to be used in this call's Do method. Any
  12950. // pending HTTP request will be aborted if the provided context is
  12951. // canceled.
  12952. func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall {
  12953. c.ctx_ = ctx
  12954. return c
  12955. }
  12956. // Header returns an http.Header that can be modified by the caller to
  12957. // add HTTP headers to the request.
  12958. func (c *UsersGetAvailableProductSetCall) Header() http.Header {
  12959. if c.header_ == nil {
  12960. c.header_ = make(http.Header)
  12961. }
  12962. return c.header_
  12963. }
  12964. func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
  12965. reqHeaders := make(http.Header)
  12966. for k, v := range c.header_ {
  12967. reqHeaders[k] = v
  12968. }
  12969. reqHeaders.Set("User-Agent", c.s.userAgent())
  12970. if c.ifNoneMatch_ != "" {
  12971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12972. }
  12973. var body io.Reader = nil
  12974. c.urlParams_.Set("alt", alt)
  12975. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
  12976. urls += "?" + c.urlParams_.Encode()
  12977. req, _ := http.NewRequest("GET", urls, body)
  12978. req.Header = reqHeaders
  12979. googleapi.Expand(req.URL, map[string]string{
  12980. "enterpriseId": c.enterpriseId,
  12981. "userId": c.userId,
  12982. })
  12983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12984. }
  12985. // Do executes the "androidenterprise.users.getAvailableProductSet" call.
  12986. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  12987. // status code is an error. Response headers are in either
  12988. // *ProductSet.ServerResponse.Header or (if a response was returned at
  12989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12990. // to check whether the returned error was because
  12991. // http.StatusNotModified was returned.
  12992. func (c *UsersGetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  12993. gensupport.SetOptions(c.urlParams_, opts...)
  12994. res, err := c.doRequest("json")
  12995. if res != nil && res.StatusCode == http.StatusNotModified {
  12996. if res.Body != nil {
  12997. res.Body.Close()
  12998. }
  12999. return nil, &googleapi.Error{
  13000. Code: res.StatusCode,
  13001. Header: res.Header,
  13002. }
  13003. }
  13004. if err != nil {
  13005. return nil, err
  13006. }
  13007. defer googleapi.CloseBody(res)
  13008. if err := googleapi.CheckResponse(res); err != nil {
  13009. return nil, err
  13010. }
  13011. ret := &ProductSet{
  13012. ServerResponse: googleapi.ServerResponse{
  13013. Header: res.Header,
  13014. HTTPStatusCode: res.StatusCode,
  13015. },
  13016. }
  13017. target := &ret
  13018. if err := gensupport.DecodeResponse(target, res); err != nil {
  13019. return nil, err
  13020. }
  13021. return ret, nil
  13022. // {
  13023. // "description": "Retrieves the set of products a user is entitled to access.",
  13024. // "httpMethod": "GET",
  13025. // "id": "androidenterprise.users.getAvailableProductSet",
  13026. // "parameterOrder": [
  13027. // "enterpriseId",
  13028. // "userId"
  13029. // ],
  13030. // "parameters": {
  13031. // "enterpriseId": {
  13032. // "description": "The ID of the enterprise.",
  13033. // "location": "path",
  13034. // "required": true,
  13035. // "type": "string"
  13036. // },
  13037. // "userId": {
  13038. // "description": "The ID of the user.",
  13039. // "location": "path",
  13040. // "required": true,
  13041. // "type": "string"
  13042. // }
  13043. // },
  13044. // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
  13045. // "response": {
  13046. // "$ref": "ProductSet"
  13047. // },
  13048. // "scopes": [
  13049. // "https://www.googleapis.com/auth/androidenterprise"
  13050. // ]
  13051. // }
  13052. }
  13053. // method id "androidenterprise.users.insert":
  13054. type UsersInsertCall struct {
  13055. s *Service
  13056. enterpriseId string
  13057. user *User
  13058. urlParams_ gensupport.URLParams
  13059. ctx_ context.Context
  13060. header_ http.Header
  13061. }
  13062. // Insert: Creates a new EMM-managed user.
  13063. //
  13064. // The Users resource passed in the body of the request should include
  13065. // an accountIdentifier and an accountType.
  13066. // If a corresponding user already exists with the same account
  13067. // identifier, the user will be updated with the resource. In this case
  13068. // only the displayName field can be changed.
  13069. func (r *UsersService) Insert(enterpriseId string, user *User) *UsersInsertCall {
  13070. c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13071. c.enterpriseId = enterpriseId
  13072. c.user = user
  13073. return c
  13074. }
  13075. // Fields allows partial responses to be retrieved. See
  13076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13077. // for more information.
  13078. func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
  13079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13080. return c
  13081. }
  13082. // Context sets the context to be used in this call's Do method. Any
  13083. // pending HTTP request will be aborted if the provided context is
  13084. // canceled.
  13085. func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
  13086. c.ctx_ = ctx
  13087. return c
  13088. }
  13089. // Header returns an http.Header that can be modified by the caller to
  13090. // add HTTP headers to the request.
  13091. func (c *UsersInsertCall) Header() http.Header {
  13092. if c.header_ == nil {
  13093. c.header_ = make(http.Header)
  13094. }
  13095. return c.header_
  13096. }
  13097. func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
  13098. reqHeaders := make(http.Header)
  13099. for k, v := range c.header_ {
  13100. reqHeaders[k] = v
  13101. }
  13102. reqHeaders.Set("User-Agent", c.s.userAgent())
  13103. var body io.Reader = nil
  13104. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  13105. if err != nil {
  13106. return nil, err
  13107. }
  13108. reqHeaders.Set("Content-Type", "application/json")
  13109. c.urlParams_.Set("alt", alt)
  13110. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users")
  13111. urls += "?" + c.urlParams_.Encode()
  13112. req, _ := http.NewRequest("POST", urls, body)
  13113. req.Header = reqHeaders
  13114. googleapi.Expand(req.URL, map[string]string{
  13115. "enterpriseId": c.enterpriseId,
  13116. })
  13117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13118. }
  13119. // Do executes the "androidenterprise.users.insert" call.
  13120. // Exactly one of *User or error will be non-nil. Any non-2xx status
  13121. // code is an error. Response headers are in either
  13122. // *User.ServerResponse.Header or (if a response was returned at all) in
  13123. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13124. // whether the returned error was because http.StatusNotModified was
  13125. // returned.
  13126. func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*User, error) {
  13127. gensupport.SetOptions(c.urlParams_, opts...)
  13128. res, err := c.doRequest("json")
  13129. if res != nil && res.StatusCode == http.StatusNotModified {
  13130. if res.Body != nil {
  13131. res.Body.Close()
  13132. }
  13133. return nil, &googleapi.Error{
  13134. Code: res.StatusCode,
  13135. Header: res.Header,
  13136. }
  13137. }
  13138. if err != nil {
  13139. return nil, err
  13140. }
  13141. defer googleapi.CloseBody(res)
  13142. if err := googleapi.CheckResponse(res); err != nil {
  13143. return nil, err
  13144. }
  13145. ret := &User{
  13146. ServerResponse: googleapi.ServerResponse{
  13147. Header: res.Header,
  13148. HTTPStatusCode: res.StatusCode,
  13149. },
  13150. }
  13151. target := &ret
  13152. if err := gensupport.DecodeResponse(target, res); err != nil {
  13153. return nil, err
  13154. }
  13155. return ret, nil
  13156. // {
  13157. // "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.",
  13158. // "httpMethod": "POST",
  13159. // "id": "androidenterprise.users.insert",
  13160. // "parameterOrder": [
  13161. // "enterpriseId"
  13162. // ],
  13163. // "parameters": {
  13164. // "enterpriseId": {
  13165. // "description": "The ID of the enterprise.",
  13166. // "location": "path",
  13167. // "required": true,
  13168. // "type": "string"
  13169. // }
  13170. // },
  13171. // "path": "enterprises/{enterpriseId}/users",
  13172. // "request": {
  13173. // "$ref": "User"
  13174. // },
  13175. // "response": {
  13176. // "$ref": "User"
  13177. // },
  13178. // "scopes": [
  13179. // "https://www.googleapis.com/auth/androidenterprise"
  13180. // ]
  13181. // }
  13182. }
  13183. // method id "androidenterprise.users.list":
  13184. type UsersListCall struct {
  13185. s *Service
  13186. enterpriseId string
  13187. urlParams_ gensupport.URLParams
  13188. ifNoneMatch_ string
  13189. ctx_ context.Context
  13190. header_ http.Header
  13191. }
  13192. // List: Looks up a user by primary email address. This is only
  13193. // supported for Google-managed users. Lookup of the id is not needed
  13194. // for EMM-managed users because the id is already returned in the
  13195. // result of the Users.insert call.
  13196. func (r *UsersService) List(enterpriseId string, email string) *UsersListCall {
  13197. c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13198. c.enterpriseId = enterpriseId
  13199. c.urlParams_.Set("email", email)
  13200. return c
  13201. }
  13202. // Fields allows partial responses to be retrieved. See
  13203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13204. // for more information.
  13205. func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
  13206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13207. return c
  13208. }
  13209. // IfNoneMatch sets the optional parameter which makes the operation
  13210. // fail if the object's ETag matches the given value. This is useful for
  13211. // getting updates only after the object has changed since the last
  13212. // request. Use googleapi.IsNotModified to check whether the response
  13213. // error from Do is the result of In-None-Match.
  13214. func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
  13215. c.ifNoneMatch_ = entityTag
  13216. return c
  13217. }
  13218. // Context sets the context to be used in this call's Do method. Any
  13219. // pending HTTP request will be aborted if the provided context is
  13220. // canceled.
  13221. func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
  13222. c.ctx_ = ctx
  13223. return c
  13224. }
  13225. // Header returns an http.Header that can be modified by the caller to
  13226. // add HTTP headers to the request.
  13227. func (c *UsersListCall) Header() http.Header {
  13228. if c.header_ == nil {
  13229. c.header_ = make(http.Header)
  13230. }
  13231. return c.header_
  13232. }
  13233. func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
  13234. reqHeaders := make(http.Header)
  13235. for k, v := range c.header_ {
  13236. reqHeaders[k] = v
  13237. }
  13238. reqHeaders.Set("User-Agent", c.s.userAgent())
  13239. if c.ifNoneMatch_ != "" {
  13240. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13241. }
  13242. var body io.Reader = nil
  13243. c.urlParams_.Set("alt", alt)
  13244. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users")
  13245. urls += "?" + c.urlParams_.Encode()
  13246. req, _ := http.NewRequest("GET", urls, body)
  13247. req.Header = reqHeaders
  13248. googleapi.Expand(req.URL, map[string]string{
  13249. "enterpriseId": c.enterpriseId,
  13250. })
  13251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13252. }
  13253. // Do executes the "androidenterprise.users.list" call.
  13254. // Exactly one of *UsersListResponse or error will be non-nil. Any
  13255. // non-2xx status code is an error. Response headers are in either
  13256. // *UsersListResponse.ServerResponse.Header or (if a response was
  13257. // returned at all) in error.(*googleapi.Error).Header. Use
  13258. // googleapi.IsNotModified to check whether the returned error was
  13259. // because http.StatusNotModified was returned.
  13260. func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
  13261. gensupport.SetOptions(c.urlParams_, opts...)
  13262. res, err := c.doRequest("json")
  13263. if res != nil && res.StatusCode == http.StatusNotModified {
  13264. if res.Body != nil {
  13265. res.Body.Close()
  13266. }
  13267. return nil, &googleapi.Error{
  13268. Code: res.StatusCode,
  13269. Header: res.Header,
  13270. }
  13271. }
  13272. if err != nil {
  13273. return nil, err
  13274. }
  13275. defer googleapi.CloseBody(res)
  13276. if err := googleapi.CheckResponse(res); err != nil {
  13277. return nil, err
  13278. }
  13279. ret := &UsersListResponse{
  13280. ServerResponse: googleapi.ServerResponse{
  13281. Header: res.Header,
  13282. HTTPStatusCode: res.StatusCode,
  13283. },
  13284. }
  13285. target := &ret
  13286. if err := gensupport.DecodeResponse(target, res); err != nil {
  13287. return nil, err
  13288. }
  13289. return ret, nil
  13290. // {
  13291. // "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.",
  13292. // "httpMethod": "GET",
  13293. // "id": "androidenterprise.users.list",
  13294. // "parameterOrder": [
  13295. // "enterpriseId",
  13296. // "email"
  13297. // ],
  13298. // "parameters": {
  13299. // "email": {
  13300. // "description": "The exact primary email address of the user to look up.",
  13301. // "location": "query",
  13302. // "required": true,
  13303. // "type": "string"
  13304. // },
  13305. // "enterpriseId": {
  13306. // "description": "The ID of the enterprise.",
  13307. // "location": "path",
  13308. // "required": true,
  13309. // "type": "string"
  13310. // }
  13311. // },
  13312. // "path": "enterprises/{enterpriseId}/users",
  13313. // "response": {
  13314. // "$ref": "UsersListResponse"
  13315. // },
  13316. // "scopes": [
  13317. // "https://www.googleapis.com/auth/androidenterprise"
  13318. // ]
  13319. // }
  13320. }
  13321. // method id "androidenterprise.users.patch":
  13322. type UsersPatchCall struct {
  13323. s *Service
  13324. enterpriseId string
  13325. userId string
  13326. user *User
  13327. urlParams_ gensupport.URLParams
  13328. ctx_ context.Context
  13329. header_ http.Header
  13330. }
  13331. // Patch: Updates the details of an EMM-managed user.
  13332. //
  13333. // Can be used with EMM-managed users only (not Google managed users).
  13334. // Pass the new details in the Users resource in the request body. Only
  13335. // the displayName field can be changed. Other fields must either be
  13336. // unset or have the currently active value. This method supports patch
  13337. // semantics.
  13338. func (r *UsersService) Patch(enterpriseId string, userId string, user *User) *UsersPatchCall {
  13339. c := &UsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13340. c.enterpriseId = enterpriseId
  13341. c.userId = userId
  13342. c.user = user
  13343. return c
  13344. }
  13345. // Fields allows partial responses to be retrieved. See
  13346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13347. // for more information.
  13348. func (c *UsersPatchCall) Fields(s ...googleapi.Field) *UsersPatchCall {
  13349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13350. return c
  13351. }
  13352. // Context sets the context to be used in this call's Do method. Any
  13353. // pending HTTP request will be aborted if the provided context is
  13354. // canceled.
  13355. func (c *UsersPatchCall) Context(ctx context.Context) *UsersPatchCall {
  13356. c.ctx_ = ctx
  13357. return c
  13358. }
  13359. // Header returns an http.Header that can be modified by the caller to
  13360. // add HTTP headers to the request.
  13361. func (c *UsersPatchCall) Header() http.Header {
  13362. if c.header_ == nil {
  13363. c.header_ = make(http.Header)
  13364. }
  13365. return c.header_
  13366. }
  13367. func (c *UsersPatchCall) doRequest(alt string) (*http.Response, error) {
  13368. reqHeaders := make(http.Header)
  13369. for k, v := range c.header_ {
  13370. reqHeaders[k] = v
  13371. }
  13372. reqHeaders.Set("User-Agent", c.s.userAgent())
  13373. var body io.Reader = nil
  13374. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  13375. if err != nil {
  13376. return nil, err
  13377. }
  13378. reqHeaders.Set("Content-Type", "application/json")
  13379. c.urlParams_.Set("alt", alt)
  13380. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  13381. urls += "?" + c.urlParams_.Encode()
  13382. req, _ := http.NewRequest("PATCH", urls, body)
  13383. req.Header = reqHeaders
  13384. googleapi.Expand(req.URL, map[string]string{
  13385. "enterpriseId": c.enterpriseId,
  13386. "userId": c.userId,
  13387. })
  13388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13389. }
  13390. // Do executes the "androidenterprise.users.patch" call.
  13391. // Exactly one of *User or error will be non-nil. Any non-2xx status
  13392. // code is an error. Response headers are in either
  13393. // *User.ServerResponse.Header or (if a response was returned at all) in
  13394. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13395. // whether the returned error was because http.StatusNotModified was
  13396. // returned.
  13397. func (c *UsersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) {
  13398. gensupport.SetOptions(c.urlParams_, opts...)
  13399. res, err := c.doRequest("json")
  13400. if res != nil && res.StatusCode == http.StatusNotModified {
  13401. if res.Body != nil {
  13402. res.Body.Close()
  13403. }
  13404. return nil, &googleapi.Error{
  13405. Code: res.StatusCode,
  13406. Header: res.Header,
  13407. }
  13408. }
  13409. if err != nil {
  13410. return nil, err
  13411. }
  13412. defer googleapi.CloseBody(res)
  13413. if err := googleapi.CheckResponse(res); err != nil {
  13414. return nil, err
  13415. }
  13416. ret := &User{
  13417. ServerResponse: googleapi.ServerResponse{
  13418. Header: res.Header,
  13419. HTTPStatusCode: res.StatusCode,
  13420. },
  13421. }
  13422. target := &ret
  13423. if err := gensupport.DecodeResponse(target, res); err != nil {
  13424. return nil, err
  13425. }
  13426. return ret, nil
  13427. // {
  13428. // "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.",
  13429. // "httpMethod": "PATCH",
  13430. // "id": "androidenterprise.users.patch",
  13431. // "parameterOrder": [
  13432. // "enterpriseId",
  13433. // "userId"
  13434. // ],
  13435. // "parameters": {
  13436. // "enterpriseId": {
  13437. // "description": "The ID of the enterprise.",
  13438. // "location": "path",
  13439. // "required": true,
  13440. // "type": "string"
  13441. // },
  13442. // "userId": {
  13443. // "description": "The ID of the user.",
  13444. // "location": "path",
  13445. // "required": true,
  13446. // "type": "string"
  13447. // }
  13448. // },
  13449. // "path": "enterprises/{enterpriseId}/users/{userId}",
  13450. // "request": {
  13451. // "$ref": "User"
  13452. // },
  13453. // "response": {
  13454. // "$ref": "User"
  13455. // },
  13456. // "scopes": [
  13457. // "https://www.googleapis.com/auth/androidenterprise"
  13458. // ]
  13459. // }
  13460. }
  13461. // method id "androidenterprise.users.revokeDeviceAccess":
  13462. type UsersRevokeDeviceAccessCall struct {
  13463. s *Service
  13464. enterpriseId string
  13465. userId string
  13466. urlParams_ gensupport.URLParams
  13467. ctx_ context.Context
  13468. header_ http.Header
  13469. }
  13470. // RevokeDeviceAccess: Revokes access to all devices currently
  13471. // provisioned to the user. The user will no longer be able to use the
  13472. // managed Play store on any of their managed devices.
  13473. //
  13474. // This call only works with EMM-managed accounts.
  13475. func (r *UsersService) RevokeDeviceAccess(enterpriseId string, userId string) *UsersRevokeDeviceAccessCall {
  13476. c := &UsersRevokeDeviceAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13477. c.enterpriseId = enterpriseId
  13478. c.userId = userId
  13479. return c
  13480. }
  13481. // Fields allows partial responses to be retrieved. See
  13482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13483. // for more information.
  13484. func (c *UsersRevokeDeviceAccessCall) Fields(s ...googleapi.Field) *UsersRevokeDeviceAccessCall {
  13485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13486. return c
  13487. }
  13488. // Context sets the context to be used in this call's Do method. Any
  13489. // pending HTTP request will be aborted if the provided context is
  13490. // canceled.
  13491. func (c *UsersRevokeDeviceAccessCall) Context(ctx context.Context) *UsersRevokeDeviceAccessCall {
  13492. c.ctx_ = ctx
  13493. return c
  13494. }
  13495. // Header returns an http.Header that can be modified by the caller to
  13496. // add HTTP headers to the request.
  13497. func (c *UsersRevokeDeviceAccessCall) Header() http.Header {
  13498. if c.header_ == nil {
  13499. c.header_ = make(http.Header)
  13500. }
  13501. return c.header_
  13502. }
  13503. func (c *UsersRevokeDeviceAccessCall) doRequest(alt string) (*http.Response, error) {
  13504. reqHeaders := make(http.Header)
  13505. for k, v := range c.header_ {
  13506. reqHeaders[k] = v
  13507. }
  13508. reqHeaders.Set("User-Agent", c.s.userAgent())
  13509. var body io.Reader = nil
  13510. c.urlParams_.Set("alt", alt)
  13511. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/deviceAccess")
  13512. urls += "?" + c.urlParams_.Encode()
  13513. req, _ := http.NewRequest("DELETE", urls, body)
  13514. req.Header = reqHeaders
  13515. googleapi.Expand(req.URL, map[string]string{
  13516. "enterpriseId": c.enterpriseId,
  13517. "userId": c.userId,
  13518. })
  13519. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13520. }
  13521. // Do executes the "androidenterprise.users.revokeDeviceAccess" call.
  13522. func (c *UsersRevokeDeviceAccessCall) Do(opts ...googleapi.CallOption) error {
  13523. gensupport.SetOptions(c.urlParams_, opts...)
  13524. res, err := c.doRequest("json")
  13525. if err != nil {
  13526. return err
  13527. }
  13528. defer googleapi.CloseBody(res)
  13529. if err := googleapi.CheckResponse(res); err != nil {
  13530. return err
  13531. }
  13532. return nil
  13533. // {
  13534. // "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.",
  13535. // "httpMethod": "DELETE",
  13536. // "id": "androidenterprise.users.revokeDeviceAccess",
  13537. // "parameterOrder": [
  13538. // "enterpriseId",
  13539. // "userId"
  13540. // ],
  13541. // "parameters": {
  13542. // "enterpriseId": {
  13543. // "description": "The ID of the enterprise.",
  13544. // "location": "path",
  13545. // "required": true,
  13546. // "type": "string"
  13547. // },
  13548. // "userId": {
  13549. // "description": "The ID of the user.",
  13550. // "location": "path",
  13551. // "required": true,
  13552. // "type": "string"
  13553. // }
  13554. // },
  13555. // "path": "enterprises/{enterpriseId}/users/{userId}/deviceAccess",
  13556. // "scopes": [
  13557. // "https://www.googleapis.com/auth/androidenterprise"
  13558. // ]
  13559. // }
  13560. }
  13561. // method id "androidenterprise.users.revokeToken":
  13562. type UsersRevokeTokenCall struct {
  13563. s *Service
  13564. enterpriseId string
  13565. userId string
  13566. urlParams_ gensupport.URLParams
  13567. ctx_ context.Context
  13568. header_ http.Header
  13569. }
  13570. // RevokeToken: Revokes a previously generated token (activation code)
  13571. // for the user.
  13572. func (r *UsersService) RevokeToken(enterpriseId string, userId string) *UsersRevokeTokenCall {
  13573. c := &UsersRevokeTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13574. c.enterpriseId = enterpriseId
  13575. c.userId = userId
  13576. return c
  13577. }
  13578. // Fields allows partial responses to be retrieved. See
  13579. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13580. // for more information.
  13581. func (c *UsersRevokeTokenCall) Fields(s ...googleapi.Field) *UsersRevokeTokenCall {
  13582. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13583. return c
  13584. }
  13585. // Context sets the context to be used in this call's Do method. Any
  13586. // pending HTTP request will be aborted if the provided context is
  13587. // canceled.
  13588. func (c *UsersRevokeTokenCall) Context(ctx context.Context) *UsersRevokeTokenCall {
  13589. c.ctx_ = ctx
  13590. return c
  13591. }
  13592. // Header returns an http.Header that can be modified by the caller to
  13593. // add HTTP headers to the request.
  13594. func (c *UsersRevokeTokenCall) Header() http.Header {
  13595. if c.header_ == nil {
  13596. c.header_ = make(http.Header)
  13597. }
  13598. return c.header_
  13599. }
  13600. func (c *UsersRevokeTokenCall) doRequest(alt string) (*http.Response, error) {
  13601. reqHeaders := make(http.Header)
  13602. for k, v := range c.header_ {
  13603. reqHeaders[k] = v
  13604. }
  13605. reqHeaders.Set("User-Agent", c.s.userAgent())
  13606. var body io.Reader = nil
  13607. c.urlParams_.Set("alt", alt)
  13608. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
  13609. urls += "?" + c.urlParams_.Encode()
  13610. req, _ := http.NewRequest("DELETE", urls, body)
  13611. req.Header = reqHeaders
  13612. googleapi.Expand(req.URL, map[string]string{
  13613. "enterpriseId": c.enterpriseId,
  13614. "userId": c.userId,
  13615. })
  13616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13617. }
  13618. // Do executes the "androidenterprise.users.revokeToken" call.
  13619. func (c *UsersRevokeTokenCall) Do(opts ...googleapi.CallOption) error {
  13620. gensupport.SetOptions(c.urlParams_, opts...)
  13621. res, err := c.doRequest("json")
  13622. if err != nil {
  13623. return err
  13624. }
  13625. defer googleapi.CloseBody(res)
  13626. if err := googleapi.CheckResponse(res); err != nil {
  13627. return err
  13628. }
  13629. return nil
  13630. // {
  13631. // "description": "Revokes a previously generated token (activation code) for the user.",
  13632. // "httpMethod": "DELETE",
  13633. // "id": "androidenterprise.users.revokeToken",
  13634. // "parameterOrder": [
  13635. // "enterpriseId",
  13636. // "userId"
  13637. // ],
  13638. // "parameters": {
  13639. // "enterpriseId": {
  13640. // "description": "The ID of the enterprise.",
  13641. // "location": "path",
  13642. // "required": true,
  13643. // "type": "string"
  13644. // },
  13645. // "userId": {
  13646. // "description": "The ID of the user.",
  13647. // "location": "path",
  13648. // "required": true,
  13649. // "type": "string"
  13650. // }
  13651. // },
  13652. // "path": "enterprises/{enterpriseId}/users/{userId}/token",
  13653. // "scopes": [
  13654. // "https://www.googleapis.com/auth/androidenterprise"
  13655. // ]
  13656. // }
  13657. }
  13658. // method id "androidenterprise.users.setAvailableProductSet":
  13659. type UsersSetAvailableProductSetCall struct {
  13660. s *Service
  13661. enterpriseId string
  13662. userId string
  13663. productset *ProductSet
  13664. urlParams_ gensupport.URLParams
  13665. ctx_ context.Context
  13666. header_ http.Header
  13667. }
  13668. // SetAvailableProductSet: Modifies the set of products that a user is
  13669. // entitled to access (referred to as whitelisted products). Only
  13670. // products that are approved or products that were previously approved
  13671. // (products with revoked approval) can be whitelisted.
  13672. func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall {
  13673. c := &UsersSetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13674. c.enterpriseId = enterpriseId
  13675. c.userId = userId
  13676. c.productset = productset
  13677. return c
  13678. }
  13679. // Fields allows partial responses to be retrieved. See
  13680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13681. // for more information.
  13682. func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall {
  13683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13684. return c
  13685. }
  13686. // Context sets the context to be used in this call's Do method. Any
  13687. // pending HTTP request will be aborted if the provided context is
  13688. // canceled.
  13689. func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall {
  13690. c.ctx_ = ctx
  13691. return c
  13692. }
  13693. // Header returns an http.Header that can be modified by the caller to
  13694. // add HTTP headers to the request.
  13695. func (c *UsersSetAvailableProductSetCall) Header() http.Header {
  13696. if c.header_ == nil {
  13697. c.header_ = make(http.Header)
  13698. }
  13699. return c.header_
  13700. }
  13701. func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
  13702. reqHeaders := make(http.Header)
  13703. for k, v := range c.header_ {
  13704. reqHeaders[k] = v
  13705. }
  13706. reqHeaders.Set("User-Agent", c.s.userAgent())
  13707. var body io.Reader = nil
  13708. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset)
  13709. if err != nil {
  13710. return nil, err
  13711. }
  13712. reqHeaders.Set("Content-Type", "application/json")
  13713. c.urlParams_.Set("alt", alt)
  13714. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
  13715. urls += "?" + c.urlParams_.Encode()
  13716. req, _ := http.NewRequest("PUT", urls, body)
  13717. req.Header = reqHeaders
  13718. googleapi.Expand(req.URL, map[string]string{
  13719. "enterpriseId": c.enterpriseId,
  13720. "userId": c.userId,
  13721. })
  13722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13723. }
  13724. // Do executes the "androidenterprise.users.setAvailableProductSet" call.
  13725. // Exactly one of *ProductSet or error will be non-nil. Any non-2xx
  13726. // status code is an error. Response headers are in either
  13727. // *ProductSet.ServerResponse.Header or (if a response was returned at
  13728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13729. // to check whether the returned error was because
  13730. // http.StatusNotModified was returned.
  13731. func (c *UsersSetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
  13732. gensupport.SetOptions(c.urlParams_, opts...)
  13733. res, err := c.doRequest("json")
  13734. if res != nil && res.StatusCode == http.StatusNotModified {
  13735. if res.Body != nil {
  13736. res.Body.Close()
  13737. }
  13738. return nil, &googleapi.Error{
  13739. Code: res.StatusCode,
  13740. Header: res.Header,
  13741. }
  13742. }
  13743. if err != nil {
  13744. return nil, err
  13745. }
  13746. defer googleapi.CloseBody(res)
  13747. if err := googleapi.CheckResponse(res); err != nil {
  13748. return nil, err
  13749. }
  13750. ret := &ProductSet{
  13751. ServerResponse: googleapi.ServerResponse{
  13752. Header: res.Header,
  13753. HTTPStatusCode: res.StatusCode,
  13754. },
  13755. }
  13756. target := &ret
  13757. if err := gensupport.DecodeResponse(target, res); err != nil {
  13758. return nil, err
  13759. }
  13760. return ret, nil
  13761. // {
  13762. // "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.",
  13763. // "httpMethod": "PUT",
  13764. // "id": "androidenterprise.users.setAvailableProductSet",
  13765. // "parameterOrder": [
  13766. // "enterpriseId",
  13767. // "userId"
  13768. // ],
  13769. // "parameters": {
  13770. // "enterpriseId": {
  13771. // "description": "The ID of the enterprise.",
  13772. // "location": "path",
  13773. // "required": true,
  13774. // "type": "string"
  13775. // },
  13776. // "userId": {
  13777. // "description": "The ID of the user.",
  13778. // "location": "path",
  13779. // "required": true,
  13780. // "type": "string"
  13781. // }
  13782. // },
  13783. // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
  13784. // "request": {
  13785. // "$ref": "ProductSet"
  13786. // },
  13787. // "response": {
  13788. // "$ref": "ProductSet"
  13789. // },
  13790. // "scopes": [
  13791. // "https://www.googleapis.com/auth/androidenterprise"
  13792. // ]
  13793. // }
  13794. }
  13795. // method id "androidenterprise.users.update":
  13796. type UsersUpdateCall struct {
  13797. s *Service
  13798. enterpriseId string
  13799. userId string
  13800. user *User
  13801. urlParams_ gensupport.URLParams
  13802. ctx_ context.Context
  13803. header_ http.Header
  13804. }
  13805. // Update: Updates the details of an EMM-managed user.
  13806. //
  13807. // Can be used with EMM-managed users only (not Google managed users).
  13808. // Pass the new details in the Users resource in the request body. Only
  13809. // the displayName field can be changed. Other fields must either be
  13810. // unset or have the currently active value.
  13811. func (r *UsersService) Update(enterpriseId string, userId string, user *User) *UsersUpdateCall {
  13812. c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13813. c.enterpriseId = enterpriseId
  13814. c.userId = userId
  13815. c.user = user
  13816. return c
  13817. }
  13818. // Fields allows partial responses to be retrieved. See
  13819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13820. // for more information.
  13821. func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall {
  13822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13823. return c
  13824. }
  13825. // Context sets the context to be used in this call's Do method. Any
  13826. // pending HTTP request will be aborted if the provided context is
  13827. // canceled.
  13828. func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall {
  13829. c.ctx_ = ctx
  13830. return c
  13831. }
  13832. // Header returns an http.Header that can be modified by the caller to
  13833. // add HTTP headers to the request.
  13834. func (c *UsersUpdateCall) Header() http.Header {
  13835. if c.header_ == nil {
  13836. c.header_ = make(http.Header)
  13837. }
  13838. return c.header_
  13839. }
  13840. func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) {
  13841. reqHeaders := make(http.Header)
  13842. for k, v := range c.header_ {
  13843. reqHeaders[k] = v
  13844. }
  13845. reqHeaders.Set("User-Agent", c.s.userAgent())
  13846. var body io.Reader = nil
  13847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
  13848. if err != nil {
  13849. return nil, err
  13850. }
  13851. reqHeaders.Set("Content-Type", "application/json")
  13852. c.urlParams_.Set("alt", alt)
  13853. urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
  13854. urls += "?" + c.urlParams_.Encode()
  13855. req, _ := http.NewRequest("PUT", urls, body)
  13856. req.Header = reqHeaders
  13857. googleapi.Expand(req.URL, map[string]string{
  13858. "enterpriseId": c.enterpriseId,
  13859. "userId": c.userId,
  13860. })
  13861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13862. }
  13863. // Do executes the "androidenterprise.users.update" call.
  13864. // Exactly one of *User or error will be non-nil. Any non-2xx status
  13865. // code is an error. Response headers are in either
  13866. // *User.ServerResponse.Header or (if a response was returned at all) in
  13867. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13868. // whether the returned error was because http.StatusNotModified was
  13869. // returned.
  13870. func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) {
  13871. gensupport.SetOptions(c.urlParams_, opts...)
  13872. res, err := c.doRequest("json")
  13873. if res != nil && res.StatusCode == http.StatusNotModified {
  13874. if res.Body != nil {
  13875. res.Body.Close()
  13876. }
  13877. return nil, &googleapi.Error{
  13878. Code: res.StatusCode,
  13879. Header: res.Header,
  13880. }
  13881. }
  13882. if err != nil {
  13883. return nil, err
  13884. }
  13885. defer googleapi.CloseBody(res)
  13886. if err := googleapi.CheckResponse(res); err != nil {
  13887. return nil, err
  13888. }
  13889. ret := &User{
  13890. ServerResponse: googleapi.ServerResponse{
  13891. Header: res.Header,
  13892. HTTPStatusCode: res.StatusCode,
  13893. },
  13894. }
  13895. target := &ret
  13896. if err := gensupport.DecodeResponse(target, res); err != nil {
  13897. return nil, err
  13898. }
  13899. return ret, nil
  13900. // {
  13901. // "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.",
  13902. // "httpMethod": "PUT",
  13903. // "id": "androidenterprise.users.update",
  13904. // "parameterOrder": [
  13905. // "enterpriseId",
  13906. // "userId"
  13907. // ],
  13908. // "parameters": {
  13909. // "enterpriseId": {
  13910. // "description": "The ID of the enterprise.",
  13911. // "location": "path",
  13912. // "required": true,
  13913. // "type": "string"
  13914. // },
  13915. // "userId": {
  13916. // "description": "The ID of the user.",
  13917. // "location": "path",
  13918. // "required": true,
  13919. // "type": "string"
  13920. // }
  13921. // },
  13922. // "path": "enterprises/{enterpriseId}/users/{userId}",
  13923. // "request": {
  13924. // "$ref": "User"
  13925. // },
  13926. // "response": {
  13927. // "$ref": "User"
  13928. // },
  13929. // "scopes": [
  13930. // "https://www.googleapis.com/auth/androidenterprise"
  13931. // ]
  13932. // }
  13933. }