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

6108 rader
231 KiB

  1. // Package androidmanagement provides access to the Android Management API.
  2. //
  3. // See https://developers.google.com/android/management
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/androidmanagement/v1"
  8. // ...
  9. // androidmanagementService, err := androidmanagement.New(oauthHttpClient)
  10. package androidmanagement // import "google.golang.org/api/androidmanagement/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 = "androidmanagement:v1"
  41. const apiName = "androidmanagement"
  42. const apiVersion = "v1"
  43. const basePath = "https://androidmanagement.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage Android devices and apps for your customers
  47. AndroidmanagementScope = "https://www.googleapis.com/auth/androidmanagement"
  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.Enterprises = NewEnterprisesService(s)
  55. s.SignupUrls = NewSignupUrlsService(s)
  56. return s, nil
  57. }
  58. type Service struct {
  59. client *http.Client
  60. BasePath string // API endpoint base URL
  61. UserAgent string // optional additional User-Agent fragment
  62. Enterprises *EnterprisesService
  63. SignupUrls *SignupUrlsService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewEnterprisesService(s *Service) *EnterprisesService {
  72. rs := &EnterprisesService{s: s}
  73. rs.Applications = NewEnterprisesApplicationsService(s)
  74. rs.Devices = NewEnterprisesDevicesService(s)
  75. rs.EnrollmentTokens = NewEnterprisesEnrollmentTokensService(s)
  76. rs.Policies = NewEnterprisesPoliciesService(s)
  77. rs.WebTokens = NewEnterprisesWebTokensService(s)
  78. return rs
  79. }
  80. type EnterprisesService struct {
  81. s *Service
  82. Applications *EnterprisesApplicationsService
  83. Devices *EnterprisesDevicesService
  84. EnrollmentTokens *EnterprisesEnrollmentTokensService
  85. Policies *EnterprisesPoliciesService
  86. WebTokens *EnterprisesWebTokensService
  87. }
  88. func NewEnterprisesApplicationsService(s *Service) *EnterprisesApplicationsService {
  89. rs := &EnterprisesApplicationsService{s: s}
  90. return rs
  91. }
  92. type EnterprisesApplicationsService struct {
  93. s *Service
  94. }
  95. func NewEnterprisesDevicesService(s *Service) *EnterprisesDevicesService {
  96. rs := &EnterprisesDevicesService{s: s}
  97. rs.Operations = NewEnterprisesDevicesOperationsService(s)
  98. return rs
  99. }
  100. type EnterprisesDevicesService struct {
  101. s *Service
  102. Operations *EnterprisesDevicesOperationsService
  103. }
  104. func NewEnterprisesDevicesOperationsService(s *Service) *EnterprisesDevicesOperationsService {
  105. rs := &EnterprisesDevicesOperationsService{s: s}
  106. return rs
  107. }
  108. type EnterprisesDevicesOperationsService struct {
  109. s *Service
  110. }
  111. func NewEnterprisesEnrollmentTokensService(s *Service) *EnterprisesEnrollmentTokensService {
  112. rs := &EnterprisesEnrollmentTokensService{s: s}
  113. return rs
  114. }
  115. type EnterprisesEnrollmentTokensService struct {
  116. s *Service
  117. }
  118. func NewEnterprisesPoliciesService(s *Service) *EnterprisesPoliciesService {
  119. rs := &EnterprisesPoliciesService{s: s}
  120. return rs
  121. }
  122. type EnterprisesPoliciesService struct {
  123. s *Service
  124. }
  125. func NewEnterprisesWebTokensService(s *Service) *EnterprisesWebTokensService {
  126. rs := &EnterprisesWebTokensService{s: s}
  127. return rs
  128. }
  129. type EnterprisesWebTokensService struct {
  130. s *Service
  131. }
  132. func NewSignupUrlsService(s *Service) *SignupUrlsService {
  133. rs := &SignupUrlsService{s: s}
  134. return rs
  135. }
  136. type SignupUrlsService struct {
  137. s *Service
  138. }
  139. // AlwaysOnVpnPackage: Configuration for an always-on VPN connection.
  140. type AlwaysOnVpnPackage struct {
  141. // LockdownEnabled: Disallows networking when the VPN is not connected.
  142. LockdownEnabled bool `json:"lockdownEnabled,omitempty"`
  143. // PackageName: The package name of the VPN app.
  144. PackageName string `json:"packageName,omitempty"`
  145. // ForceSendFields is a list of field names (e.g. "LockdownEnabled") to
  146. // unconditionally include in API requests. By default, fields with
  147. // empty values are omitted from API requests. However, any non-pointer,
  148. // non-interface field appearing in ForceSendFields will be sent to the
  149. // server regardless of whether the field is empty or not. This may be
  150. // used to include empty fields in Patch requests.
  151. ForceSendFields []string `json:"-"`
  152. // NullFields is a list of field names (e.g. "LockdownEnabled") to
  153. // include in API requests with the JSON null value. By default, fields
  154. // with empty values are omitted from API requests. However, any field
  155. // with an empty value appearing in NullFields will be sent to the
  156. // server as null. It is an error if a field in this list has a
  157. // non-empty value. This may be used to include null fields in Patch
  158. // requests.
  159. NullFields []string `json:"-"`
  160. }
  161. func (s *AlwaysOnVpnPackage) MarshalJSON() ([]byte, error) {
  162. type NoMethod AlwaysOnVpnPackage
  163. raw := NoMethod(*s)
  164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  165. }
  166. // ApiLevelCondition: A compliance rule condition which is satisfied if
  167. // the Android Framework API level on the device doesn't meet a minimum
  168. // requirement. There can only be one rule with this type of condition
  169. // per policy.
  170. type ApiLevelCondition struct {
  171. // MinApiLevel: The minimum desired Android Framework API level. If the
  172. // device doesn't meet the minimum requirement, this condition is
  173. // satisfied. Must be greater than zero.
  174. MinApiLevel int64 `json:"minApiLevel,omitempty"`
  175. // ForceSendFields is a list of field names (e.g. "MinApiLevel") to
  176. // unconditionally include in API requests. By default, fields with
  177. // empty values are omitted from API requests. However, any non-pointer,
  178. // non-interface field appearing in ForceSendFields will be sent to the
  179. // server regardless of whether the field is empty or not. This may be
  180. // used to include empty fields in Patch requests.
  181. ForceSendFields []string `json:"-"`
  182. // NullFields is a list of field names (e.g. "MinApiLevel") to include
  183. // in API requests with the JSON null value. By default, fields with
  184. // empty values are omitted from API requests. However, any field with
  185. // an empty value appearing in NullFields will be sent to the server as
  186. // null. It is an error if a field in this list has a non-empty value.
  187. // This may be used to include null fields in Patch requests.
  188. NullFields []string `json:"-"`
  189. }
  190. func (s *ApiLevelCondition) MarshalJSON() ([]byte, error) {
  191. type NoMethod ApiLevelCondition
  192. raw := NoMethod(*s)
  193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  194. }
  195. // Application: Information about an app.
  196. type Application struct {
  197. // ManagedProperties: The set of managed properties available to be
  198. // pre-configured for the app.
  199. ManagedProperties []*ManagedProperty `json:"managedProperties,omitempty"`
  200. // Name: The name of the app in the form
  201. // enterprises/{enterpriseId}/applications/{package_name}.
  202. Name string `json:"name,omitempty"`
  203. // Permissions: The permissions required by the app.
  204. Permissions []*ApplicationPermission `json:"permissions,omitempty"`
  205. // Title: The title of the app. Localized.
  206. Title string `json:"title,omitempty"`
  207. // ServerResponse contains the HTTP response code and headers from the
  208. // server.
  209. googleapi.ServerResponse `json:"-"`
  210. // ForceSendFields is a list of field names (e.g. "ManagedProperties")
  211. // to unconditionally include in API requests. By default, fields with
  212. // empty values are omitted from API requests. However, any non-pointer,
  213. // non-interface field appearing in ForceSendFields will be sent to the
  214. // server regardless of whether the field is empty or not. This may be
  215. // used to include empty fields in Patch requests.
  216. ForceSendFields []string `json:"-"`
  217. // NullFields is a list of field names (e.g. "ManagedProperties") to
  218. // include in API requests with the JSON null value. By default, fields
  219. // with empty values are omitted from API requests. However, any field
  220. // with an empty value appearing in NullFields will be sent to the
  221. // server as null. It is an error if a field in this list has a
  222. // non-empty value. This may be used to include null fields in Patch
  223. // requests.
  224. NullFields []string `json:"-"`
  225. }
  226. func (s *Application) MarshalJSON() ([]byte, error) {
  227. type NoMethod Application
  228. raw := NoMethod(*s)
  229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  230. }
  231. // ApplicationEvent: An app-related event.
  232. type ApplicationEvent struct {
  233. // CreateTime: The creation time of the event.
  234. CreateTime string `json:"createTime,omitempty"`
  235. // EventType: App event type.
  236. //
  237. // Possible values:
  238. // "APPLICATION_EVENT_TYPE_UNSPECIFIED" - This value is disallowed.
  239. // "INSTALLED" - The app was installed.
  240. // "CHANGED" - The app was changed, for example, a component was
  241. // enabled or disabled.
  242. // "DATA_CLEARED" - The app data was cleared.
  243. // "REMOVED" - The app was removed.
  244. // "REPLACED" - A new version of the app has been installed, replacing
  245. // the old version.
  246. // "RESTARTED" - The app was restarted.
  247. // "PINNED" - The app was pinned to the foreground.
  248. // "UNPINNED" - The app was unpinned.
  249. EventType string `json:"eventType,omitempty"`
  250. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  251. // unconditionally include in API requests. By default, fields with
  252. // empty values are omitted from API requests. However, any non-pointer,
  253. // non-interface field appearing in ForceSendFields will be sent to the
  254. // server regardless of whether the field is empty or not. This may be
  255. // used to include empty fields in Patch requests.
  256. ForceSendFields []string `json:"-"`
  257. // NullFields is a list of field names (e.g. "CreateTime") to include in
  258. // API requests with the JSON null value. By default, fields with empty
  259. // values are omitted from API requests. However, any field with an
  260. // empty value appearing in NullFields will be sent to the server as
  261. // null. It is an error if a field in this list has a non-empty value.
  262. // This may be used to include null fields in Patch requests.
  263. NullFields []string `json:"-"`
  264. }
  265. func (s *ApplicationEvent) MarshalJSON() ([]byte, error) {
  266. type NoMethod ApplicationEvent
  267. raw := NoMethod(*s)
  268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  269. }
  270. // ApplicationPermission: A permission required by the app.
  271. type ApplicationPermission struct {
  272. // Description: A longer description of the permission, providing more
  273. // detail on what it affects. Localized.
  274. Description string `json:"description,omitempty"`
  275. // Name: The name of the permission. Localized.
  276. Name string `json:"name,omitempty"`
  277. // PermissionId: An opaque string uniquely identifying the permission.
  278. // Not localized.
  279. PermissionId string `json:"permissionId,omitempty"`
  280. // ForceSendFields is a list of field names (e.g. "Description") to
  281. // unconditionally include in API requests. By default, fields with
  282. // empty values are omitted from API requests. However, any non-pointer,
  283. // non-interface field appearing in ForceSendFields will be sent to the
  284. // server regardless of whether the field is empty or not. This may be
  285. // used to include empty fields in Patch requests.
  286. ForceSendFields []string `json:"-"`
  287. // NullFields is a list of field names (e.g. "Description") to include
  288. // in API requests with the JSON null value. By default, fields with
  289. // empty values are omitted from API requests. However, any field with
  290. // an empty value appearing in NullFields will be sent to the server as
  291. // null. It is an error if a field in this list has a non-empty value.
  292. // This may be used to include null fields in Patch requests.
  293. NullFields []string `json:"-"`
  294. }
  295. func (s *ApplicationPermission) MarshalJSON() ([]byte, error) {
  296. type NoMethod ApplicationPermission
  297. raw := NoMethod(*s)
  298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  299. }
  300. // ApplicationPolicy: Policy for an individual app.
  301. type ApplicationPolicy struct {
  302. // DefaultPermissionPolicy: The default policy for all permissions
  303. // requested by the app. If specified, this overrides the policy-level
  304. // default_permission_policy which applies to all apps. It does not
  305. // override the permission_grants which applies to all apps.
  306. //
  307. // Possible values:
  308. // "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no
  309. // policy is specified for a permission at any level, then the PROMPT
  310. // behavior is used by default.
  311. // "PROMPT" - Prompt the user to grant a permission.
  312. // "GRANT" - Automatically grant a permission.
  313. // "DENY" - Automatically deny a permission.
  314. DefaultPermissionPolicy string `json:"defaultPermissionPolicy,omitempty"`
  315. // DelegatedScopes: The scopes delegated to the app from Android Device
  316. // Policy.
  317. //
  318. // Possible values:
  319. // "DELEGATED_SCOPE_UNSPECIFIED" - No delegation scope specified.
  320. // "CERT_INSTALL" - Grants access to certificate installation and
  321. // management.
  322. // "MANAGED_CONFIGURATIONS" - Grants access to managed configurations
  323. // management.
  324. // "BLOCK_UNINSTALL" - Grants access to blocking uninstallation.
  325. // "PERMISSION_GRANT" - Grants access to permission policy and
  326. // permission grant state.
  327. // "PACKAGE_ACCESS" - Grants access to package access state.
  328. // "ENABLE_SYSTEM_APP" - Grants access for enabling system apps.
  329. DelegatedScopes []string `json:"delegatedScopes,omitempty"`
  330. // Disabled: Whether the app is disabled. When disabled, the app data is
  331. // still preserved.
  332. Disabled bool `json:"disabled,omitempty"`
  333. // InstallType: The type of installation to perform.
  334. //
  335. // Possible values:
  336. // "INSTALL_TYPE_UNSPECIFIED" - Unspecified. Defaults to AVAILABLE.
  337. // "PREINSTALLED" - The app is automatically installed and can be
  338. // removed by the user.
  339. // "FORCE_INSTALLED" - The app is automatically installed and can't be
  340. // removed by the user.
  341. // "AVAILABLE" - The app is available to install.
  342. InstallType string `json:"installType,omitempty"`
  343. // LockTaskAllowed: Whether the app is allowed to lock itself in
  344. // full-screen mode.
  345. LockTaskAllowed bool `json:"lockTaskAllowed,omitempty"`
  346. // ManagedConfiguration: Managed configuration applied to the app. The
  347. // format for the configuration is dictated by the ManagedProperty
  348. // values supported by the app. Each field name in the managed
  349. // configuration must match the key field of the ManagedProperty. The
  350. // field value must be compatible with the type of the ManagedProperty:
  351. // <table> <tr><td><i>type</i></td><td><i>JSON value</i></td></tr>
  352. // <tr><td>BOOL</td><td>true or false</td></tr>
  353. // <tr><td>STRING</td><td>string</td></tr>
  354. // <tr><td>INTEGER</td><td>number</td></tr>
  355. // <tr><td>CHOICE</td><td>string</td></tr>
  356. // <tr><td>MULTISELECT</td><td>array of strings</td></tr>
  357. // <tr><td>HIDDEN</td><td>string</td></tr>
  358. // <tr><td>BUNDLE_ARRAY</td><td>array of objects</td></tr> </table>
  359. ManagedConfiguration googleapi.RawMessage `json:"managedConfiguration,omitempty"`
  360. // MinimumVersionCode: The minimum version of the app that runs on the
  361. // device. If set, the device attempts to update the app to at least
  362. // this version code. If the app is not up-to-date, the device will
  363. // contain a NonComplianceDetail with non_compliance_reason set to
  364. // APP_NOT_UPDATED. The app must already be published to Google Play
  365. // with a version code greater than or equal to this value. At most 20
  366. // apps may specify a minimum version code per policy.
  367. MinimumVersionCode int64 `json:"minimumVersionCode,omitempty"`
  368. // PackageName: The package name of the app. For example,
  369. // com.google.android.youtube for the YouTube app.
  370. PackageName string `json:"packageName,omitempty"`
  371. // PermissionGrants: Explicit permission grants or denials for the app.
  372. // These values override the default_permission_policy and
  373. // permission_grants which apply to all apps.
  374. PermissionGrants []*PermissionGrant `json:"permissionGrants,omitempty"`
  375. // ForceSendFields is a list of field names (e.g.
  376. // "DefaultPermissionPolicy") to unconditionally include in API
  377. // requests. By default, fields with empty values are omitted from API
  378. // requests. However, any non-pointer, non-interface field appearing in
  379. // ForceSendFields will be sent to the server regardless of whether the
  380. // field is empty or not. This may be used to include empty fields in
  381. // Patch requests.
  382. ForceSendFields []string `json:"-"`
  383. // NullFields is a list of field names (e.g. "DefaultPermissionPolicy")
  384. // to include in API requests with the JSON null value. By default,
  385. // fields with empty values are omitted from API requests. However, any
  386. // field with an empty value appearing in NullFields will be sent to the
  387. // server as null. It is an error if a field in this list has a
  388. // non-empty value. This may be used to include null fields in Patch
  389. // requests.
  390. NullFields []string `json:"-"`
  391. }
  392. func (s *ApplicationPolicy) MarshalJSON() ([]byte, error) {
  393. type NoMethod ApplicationPolicy
  394. raw := NoMethod(*s)
  395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  396. }
  397. // ApplicationReport: Information reported about an installed app.
  398. type ApplicationReport struct {
  399. // ApplicationSource: The source of the package.
  400. //
  401. // Possible values:
  402. // "APPLICATION_SOURCE_UNSPECIFIED" - The app was sideloaded from an
  403. // unspecified source.
  404. // "SYSTEM_APP_FACTORY_VERSION" - This is a system app from the
  405. // device's factory image.
  406. // "SYSTEM_APP_UPDATED_VERSION" - This is an updated system app.
  407. // "INSTALLED_FROM_PLAY_STORE" - The app was installed from the Google
  408. // Play Store.
  409. ApplicationSource string `json:"applicationSource,omitempty"`
  410. // DisplayName: The display name of the app.
  411. DisplayName string `json:"displayName,omitempty"`
  412. // Events: List of app events. The most recent 20 events are stored in
  413. // the list.
  414. Events []*ApplicationEvent `json:"events,omitempty"`
  415. // InstallerPackageName: The package name of the app that installed this
  416. // app.
  417. InstallerPackageName string `json:"installerPackageName,omitempty"`
  418. // PackageName: Package name of the app.
  419. PackageName string `json:"packageName,omitempty"`
  420. // PackageSha256Hash: The SHA-256 hash of the app's APK file, which can
  421. // be used to verify the app hasn't been modified. Each byte of the hash
  422. // value is represented as a two-digit hexadecimal number.
  423. PackageSha256Hash string `json:"packageSha256Hash,omitempty"`
  424. // SigningKeyCertFingerprints: The SHA-1 hash of each
  425. // android.content.pm.Signature
  426. // (https://developer.android.com/reference/android/content/pm/Signature.
  427. // html) associated with the app package. Each byte of each hash value
  428. // is represented as a two-digit hexadecimal number.
  429. SigningKeyCertFingerprints []string `json:"signingKeyCertFingerprints,omitempty"`
  430. // State: Application state.
  431. //
  432. // Possible values:
  433. // "INSTALLED" - App is installed on the device
  434. // "REMOVED" - App was removed from the device
  435. State string `json:"state,omitempty"`
  436. // VersionCode: The app version code, which can be used to determine
  437. // whether one version is more recent than another.
  438. VersionCode int64 `json:"versionCode,omitempty"`
  439. // VersionName: The app version as displayed to the user.
  440. VersionName string `json:"versionName,omitempty"`
  441. // ForceSendFields is a list of field names (e.g. "ApplicationSource")
  442. // to unconditionally include in API requests. By default, fields with
  443. // empty values are omitted from API requests. However, any non-pointer,
  444. // non-interface field appearing in ForceSendFields will be sent to the
  445. // server regardless of whether the field is empty or not. This may be
  446. // used to include empty fields in Patch requests.
  447. ForceSendFields []string `json:"-"`
  448. // NullFields is a list of field names (e.g. "ApplicationSource") to
  449. // include in API requests with the JSON null value. By default, fields
  450. // with empty values are omitted from API requests. However, any field
  451. // with an empty value appearing in NullFields will be sent to the
  452. // server as null. It is an error if a field in this list has a
  453. // non-empty value. This may be used to include null fields in Patch
  454. // requests.
  455. NullFields []string `json:"-"`
  456. }
  457. func (s *ApplicationReport) MarshalJSON() ([]byte, error) {
  458. type NoMethod ApplicationReport
  459. raw := NoMethod(*s)
  460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  461. }
  462. // ChoosePrivateKeyRule: A rule for automatically choosing a private key
  463. // and certificate to authenticate the device to a server.
  464. type ChoosePrivateKeyRule struct {
  465. // PackageNames: The package names for which outgoing requests are
  466. // subject to this rule. If no package names are specified, then the
  467. // rule applies to all packages. For each package name listed, the rule
  468. // applies to that package and all other packages that shared the same
  469. // Android UID. The SHA256 hash of the signing key signatures of each
  470. // package_name will be verified against those provided by Play
  471. PackageNames []string `json:"packageNames,omitempty"`
  472. // PrivateKeyAlias: The alias of the private key to be used.
  473. PrivateKeyAlias string `json:"privateKeyAlias,omitempty"`
  474. // UrlPattern: The URL pattern to match against the URL of the outgoing
  475. // request. The pattern may contain asterisk (*) wildcards. Any URL is
  476. // matched if unspecified.
  477. UrlPattern string `json:"urlPattern,omitempty"`
  478. // ForceSendFields is a list of field names (e.g. "PackageNames") to
  479. // unconditionally include in API requests. By default, fields with
  480. // empty values are omitted from API requests. However, any non-pointer,
  481. // non-interface field appearing in ForceSendFields will be sent to the
  482. // server regardless of whether the field is empty or not. This may be
  483. // used to include empty fields in Patch requests.
  484. ForceSendFields []string `json:"-"`
  485. // NullFields is a list of field names (e.g. "PackageNames") to include
  486. // in API requests with the JSON null value. By default, fields with
  487. // empty values are omitted from API requests. However, any field with
  488. // an empty value appearing in NullFields will be sent to the server as
  489. // null. It is an error if a field in this list has a non-empty value.
  490. // This may be used to include null fields in Patch requests.
  491. NullFields []string `json:"-"`
  492. }
  493. func (s *ChoosePrivateKeyRule) MarshalJSON() ([]byte, error) {
  494. type NoMethod ChoosePrivateKeyRule
  495. raw := NoMethod(*s)
  496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  497. }
  498. // Command: A command.
  499. type Command struct {
  500. // CreateTime: The timestamp at which the command was created. The
  501. // timestamp is automatically generated by the server.
  502. CreateTime string `json:"createTime,omitempty"`
  503. // Duration: The duration for which the command is valid. The command
  504. // will expire if not executed by the device during this time. The
  505. // default duration if unspecified is ten minutes. There is no maximum
  506. // duration.
  507. Duration string `json:"duration,omitempty"`
  508. // ErrorCode: If the command failed, an error code explaining the
  509. // failure. This is not set when the command is cancelled by the caller.
  510. //
  511. // Possible values:
  512. // "COMMAND_ERROR_CODE_UNSPECIFIED" - There was no error.
  513. // "UNKNOWN" - An unknown error occurred.
  514. // "API_LEVEL" - The API level of the device does not support this
  515. // command.
  516. // "MANAGEMENT_MODE" - The management mode (profile owner, device
  517. // owner, etc.) does not support the command.
  518. // "INVALID_VALUE" - The command has an invalid parameter value.
  519. // "UNSUPPORTED" - The device doesn't support the command. Updating
  520. // Android Device Policy to the latest version may resolve the issue.
  521. ErrorCode string `json:"errorCode,omitempty"`
  522. // NewPassword: For commands of type RESET_PASSWORD, optionally
  523. // specifies the new password.
  524. NewPassword string `json:"newPassword,omitempty"`
  525. // ResetPasswordFlags: For commands of type RESET_PASSWORD, optionally
  526. // specifies flags.
  527. //
  528. // Possible values:
  529. // "RESET_PASSWORD_FLAG_UNSPECIFIED" - This value is ignored.
  530. // "REQUIRE_ENTRY" - Don't allow other admins to change the password
  531. // again until the user has entered it.
  532. // "DO_NOT_ASK_CREDENTIALS_ON_BOOT" - Don't ask for user credentials
  533. // on device boot.
  534. // "LOCK_NOW" - Lock the device after password reset.
  535. ResetPasswordFlags []string `json:"resetPasswordFlags,omitempty"`
  536. // Type: The type of the command.
  537. //
  538. // Possible values:
  539. // "COMMAND_TYPE_UNSPECIFIED" - This value is disallowed.
  540. // "LOCK" - Lock the device, as if the lock screen timeout had
  541. // expired.
  542. // "RESET_PASSWORD" - Reset the user's password.
  543. // "REBOOT" - Reboot the device. Only supported on API level 24+.
  544. Type string `json:"type,omitempty"`
  545. // UserName: The resource name of the user that owns the device in the
  546. // form enterprises/{enterpriseId}/users/{userId}. This is automatically
  547. // generated by the server based on the device the command is sent to.
  548. UserName string `json:"userName,omitempty"`
  549. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  550. // unconditionally include in API requests. By default, fields with
  551. // empty values are omitted from API requests. However, any non-pointer,
  552. // non-interface field appearing in ForceSendFields will be sent to the
  553. // server regardless of whether the field is empty or not. This may be
  554. // used to include empty fields in Patch requests.
  555. ForceSendFields []string `json:"-"`
  556. // NullFields is a list of field names (e.g. "CreateTime") to include in
  557. // API requests with the JSON null value. By default, fields with empty
  558. // values are omitted from API requests. However, any field with an
  559. // empty value appearing in NullFields will be sent to the server as
  560. // null. It is an error if a field in this list has a non-empty value.
  561. // This may be used to include null fields in Patch requests.
  562. NullFields []string `json:"-"`
  563. }
  564. func (s *Command) MarshalJSON() ([]byte, error) {
  565. type NoMethod Command
  566. raw := NoMethod(*s)
  567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  568. }
  569. // ComplianceRule: A rule declaring which mitigating actions to take
  570. // when a device is not compliant with its policy. For every rule, there
  571. // is always an implicit mitigating action to set policy_compliant to
  572. // false for the Device resource, and display a message on the device
  573. // indicating that the device is not compliant with its policy. Other
  574. // mitigating actions may optionally be taken as well, depending on the
  575. // field values in the rule.
  576. type ComplianceRule struct {
  577. // ApiLevelCondition: A condition which is satisfied if the Android
  578. // Framework API level on the device doesn't meet a minimum requirement.
  579. ApiLevelCondition *ApiLevelCondition `json:"apiLevelCondition,omitempty"`
  580. // DisableApps: If set to true, the rule includes a mitigating action to
  581. // disable apps so that the device is effectively disabled, but app data
  582. // is preserved. If the device is running an app in locked task mode,
  583. // the app will be closed and a UI showing the reason for non-compliance
  584. // will be displayed.
  585. DisableApps bool `json:"disableApps,omitempty"`
  586. // NonComplianceDetailCondition: A condition which is satisfied if there
  587. // exists any matching NonComplianceDetail for the device.
  588. NonComplianceDetailCondition *NonComplianceDetailCondition `json:"nonComplianceDetailCondition,omitempty"`
  589. // ForceSendFields is a list of field names (e.g. "ApiLevelCondition")
  590. // to unconditionally include in API requests. By default, fields with
  591. // empty values are omitted from API requests. However, any non-pointer,
  592. // non-interface field appearing in ForceSendFields will be sent to the
  593. // server regardless of whether the field is empty or not. This may be
  594. // used to include empty fields in Patch requests.
  595. ForceSendFields []string `json:"-"`
  596. // NullFields is a list of field names (e.g. "ApiLevelCondition") to
  597. // include in API requests with the JSON null value. By default, fields
  598. // with empty values are omitted from API requests. However, any field
  599. // with an empty value appearing in NullFields will be sent to the
  600. // server as null. It is an error if a field in this list has a
  601. // non-empty value. This may be used to include null fields in Patch
  602. // requests.
  603. NullFields []string `json:"-"`
  604. }
  605. func (s *ComplianceRule) MarshalJSON() ([]byte, error) {
  606. type NoMethod ComplianceRule
  607. raw := NoMethod(*s)
  608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  609. }
  610. // Device: A device owned by an enterprise. Unless otherwise noted, all
  611. // fields are read-only and can't be modified by
  612. // enterprises.devices.patch.
  613. type Device struct {
  614. // ApiLevel: The API level of the Android platform version running on
  615. // the device.
  616. ApiLevel int64 `json:"apiLevel,omitempty"`
  617. // ApplicationReports: Reports for apps installed on the device. This
  618. // information is only available when application_reports_enabled is
  619. // true in the device's policy.
  620. ApplicationReports []*ApplicationReport `json:"applicationReports,omitempty"`
  621. // AppliedPolicyName: The name of the policy currently applied to the
  622. // device.
  623. AppliedPolicyName string `json:"appliedPolicyName,omitempty"`
  624. // AppliedPolicyVersion: The version of the policy currently applied to
  625. // the device.
  626. AppliedPolicyVersion int64 `json:"appliedPolicyVersion,omitempty,string"`
  627. // AppliedState: The state currently applied to the device.
  628. //
  629. // Possible values:
  630. // "DEVICE_STATE_UNSPECIFIED" - This value is disallowed.
  631. // "ACTIVE" - The device is active.
  632. // "DISABLED" - The device is disabled.
  633. // "DELETED" - The device was deleted. This state will never be
  634. // returned by an API call, but is used in the final policy compliance
  635. // report published to Cloud Pub/Sub when the device acknowledges the
  636. // deletion.
  637. // "PROVISIONING" - The device is being provisioned. Newly enrolled
  638. // devices are in this state until they have a policy applied.
  639. AppliedState string `json:"appliedState,omitempty"`
  640. // DeviceSettings: Device settings information. This information is only
  641. // available if deviceSettingsEnabled is true in the device's policy.
  642. DeviceSettings *DeviceSettings `json:"deviceSettings,omitempty"`
  643. // DisabledReason: If the device state is DISABLED, an optional message
  644. // that is displayed on the device indicating the reason the device is
  645. // disabled. This field can be modified by a patch request.
  646. DisabledReason *UserFacingMessage `json:"disabledReason,omitempty"`
  647. // Displays: Detailed information about displays on the device. This
  648. // information is only available if displayInfoEnabled is true in the
  649. // device's policy.
  650. Displays []*Display `json:"displays,omitempty"`
  651. // EnrollmentTime: The time of device enrollment.
  652. EnrollmentTime string `json:"enrollmentTime,omitempty"`
  653. // EnrollmentTokenData: If the device was enrolled with an enrollment
  654. // token with additional data provided, this field contains that data.
  655. EnrollmentTokenData string `json:"enrollmentTokenData,omitempty"`
  656. // EnrollmentTokenName: If the device was enrolled with an enrollment
  657. // token, this field contains the name of the token.
  658. EnrollmentTokenName string `json:"enrollmentTokenName,omitempty"`
  659. // HardwareInfo: Detailed information about the device hardware.
  660. HardwareInfo *HardwareInfo `json:"hardwareInfo,omitempty"`
  661. // HardwareStatusSamples: Hardware status samples in chronological
  662. // order. This information is only available if hardwareStatusEnabled is
  663. // true in the device's policy.
  664. HardwareStatusSamples []*HardwareStatus `json:"hardwareStatusSamples,omitempty"`
  665. // LastPolicyComplianceReportTime: The last time the device sent a
  666. // policy compliance report. Important: This field is deprecated. The
  667. // timestamp will be on last_status_report_time field, and
  668. // last_status_report_time will be used for both status report and
  669. // compliance report.
  670. LastPolicyComplianceReportTime string `json:"lastPolicyComplianceReportTime,omitempty"`
  671. // LastPolicySyncTime: The last time the device fetched its policy.
  672. LastPolicySyncTime string `json:"lastPolicySyncTime,omitempty"`
  673. // LastStatusReportTime: The last time the device sent a status report.
  674. LastStatusReportTime string `json:"lastStatusReportTime,omitempty"`
  675. // MemoryEvents: Events related to memory and storage measurements in
  676. // chronological order. This information is only available if
  677. // memoryInfoEnabled is true in the device's policy.
  678. MemoryEvents []*MemoryEvent `json:"memoryEvents,omitempty"`
  679. // MemoryInfo: Memory information. This information is only available if
  680. // memoryInfoEnabled is true in the device's policy.
  681. MemoryInfo *MemoryInfo `json:"memoryInfo,omitempty"`
  682. // Name: The name of the device in the form
  683. // enterprises/{enterpriseId}/devices/{deviceId}.
  684. Name string `json:"name,omitempty"`
  685. // NetworkInfo: Device network information. This information is only
  686. // available if networkInfoEnabled is true in the device's policy.
  687. NetworkInfo *NetworkInfo `json:"networkInfo,omitempty"`
  688. // NonComplianceDetails: Details about policy settings that the device
  689. // is not compliant with.
  690. NonComplianceDetails []*NonComplianceDetail `json:"nonComplianceDetails,omitempty"`
  691. // PolicyCompliant: Whether the device is compliant with its policy.
  692. PolicyCompliant bool `json:"policyCompliant,omitempty"`
  693. // PolicyName: The name of the policy applied to the device, in the form
  694. // enterprises/{enterpriseId}/policies/{policyId}. If not specified, the
  695. // policy_name for the device's user is applied. This field can be
  696. // modified by a patch request. You can specify only the policyId when
  697. // calling enterprises.devices.patch, as long as the policyId doesn’t
  698. // contain any slashes. The rest of the policy name is inferred.
  699. PolicyName string `json:"policyName,omitempty"`
  700. // PowerManagementEvents: Power management events on the device in
  701. // chronological order. This information is only available if
  702. // powerManagementEventsEnabled is true in the device's policy.
  703. PowerManagementEvents []*PowerManagementEvent `json:"powerManagementEvents,omitempty"`
  704. // PreviousDeviceNames: If the same physical device has been enrolled
  705. // multiple times, this field contains its previous device names. The
  706. // serial number is used as the unique identifier to determine if the
  707. // same physical device has enrolled previously. The names are in
  708. // chronological order.
  709. PreviousDeviceNames []string `json:"previousDeviceNames,omitempty"`
  710. // SoftwareInfo: Detailed information about the device software. This
  711. // information is only available if softwareInfoEnabled is true in the
  712. // device's policy.
  713. SoftwareInfo *SoftwareInfo `json:"softwareInfo,omitempty"`
  714. // State: The state to be applied to the device. This field can be
  715. // modified by a patch request. Note that when calling
  716. // enterprises.devices.patch, ACTIVE and DISABLED are the only allowable
  717. // values. To enter the device into a DELETED state, call
  718. // enterprises.devices.delete.
  719. //
  720. // Possible values:
  721. // "DEVICE_STATE_UNSPECIFIED" - This value is disallowed.
  722. // "ACTIVE" - The device is active.
  723. // "DISABLED" - The device is disabled.
  724. // "DELETED" - The device was deleted. This state will never be
  725. // returned by an API call, but is used in the final policy compliance
  726. // report published to Cloud Pub/Sub when the device acknowledges the
  727. // deletion.
  728. // "PROVISIONING" - The device is being provisioned. Newly enrolled
  729. // devices are in this state until they have a policy applied.
  730. State string `json:"state,omitempty"`
  731. // UserName: The resource name of the user that owns this device in the
  732. // form enterprises/{enterpriseId}/users/{userId}.
  733. UserName string `json:"userName,omitempty"`
  734. // ServerResponse contains the HTTP response code and headers from the
  735. // server.
  736. googleapi.ServerResponse `json:"-"`
  737. // ForceSendFields is a list of field names (e.g. "ApiLevel") to
  738. // unconditionally include in API requests. By default, fields with
  739. // empty values are omitted from API requests. However, any non-pointer,
  740. // non-interface field appearing in ForceSendFields will be sent to the
  741. // server regardless of whether the field is empty or not. This may be
  742. // used to include empty fields in Patch requests.
  743. ForceSendFields []string `json:"-"`
  744. // NullFields is a list of field names (e.g. "ApiLevel") to include in
  745. // API requests with the JSON null value. By default, fields with empty
  746. // values are omitted from API requests. However, any field with an
  747. // empty value appearing in NullFields will be sent to the server as
  748. // null. It is an error if a field in this list has a non-empty value.
  749. // This may be used to include null fields in Patch requests.
  750. NullFields []string `json:"-"`
  751. }
  752. func (s *Device) MarshalJSON() ([]byte, error) {
  753. type NoMethod Device
  754. raw := NoMethod(*s)
  755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  756. }
  757. // DeviceSettings: Information about security related device settings on
  758. // device.
  759. type DeviceSettings struct {
  760. // AdbEnabled: Whether ADB
  761. // (https://developer.android.com/studio/command-line/adb.html) is
  762. // enabled on the device.
  763. AdbEnabled bool `json:"adbEnabled,omitempty"`
  764. // DevelopmentSettingsEnabled: Whether developer mode is enabled on the
  765. // device.
  766. DevelopmentSettingsEnabled bool `json:"developmentSettingsEnabled,omitempty"`
  767. // EncryptionStatus: Encryption status from DevicePolicyManager.
  768. //
  769. // Possible values:
  770. // "ENCRYPTION_STATUS_UNSPECIFIED" - Unspecified. No device should
  771. // have this type.
  772. // "UNSUPPORTED" - Encryption is not supported by the device.
  773. // "INACTIVE" - Encryption is supported by the device, but is not
  774. // currently active.
  775. // "ACTIVATING" - Encryption is not currently active, but is currently
  776. // being activated.
  777. // "ACTIVE" - Encryption is active.
  778. // "ACTIVE_DEFAULT_KEY" - Encryption is active, but an encryption key
  779. // is not set by the user.
  780. // "ACTIVE_PER_USER" - Encryption is active, and the encryption key is
  781. // tied to the user profile.
  782. EncryptionStatus string `json:"encryptionStatus,omitempty"`
  783. // IsDeviceSecure: Whether the device is secured with PIN/password.
  784. IsDeviceSecure bool `json:"isDeviceSecure,omitempty"`
  785. // IsEncrypted: Whether the storage encryption is enabled.
  786. IsEncrypted bool `json:"isEncrypted,omitempty"`
  787. // UnknownSourcesEnabled: Whether installing apps from unknown sources
  788. // is enabled.
  789. UnknownSourcesEnabled bool `json:"unknownSourcesEnabled,omitempty"`
  790. // VerifyAppsEnabled: Whether Verify Apps (Google Play Protect
  791. // (https://support.google.com/googleplay/answer/2812853)) is enabled on
  792. // the device.
  793. VerifyAppsEnabled bool `json:"verifyAppsEnabled,omitempty"`
  794. // ForceSendFields is a list of field names (e.g. "AdbEnabled") to
  795. // unconditionally include in API requests. By default, fields with
  796. // empty values are omitted from API requests. However, any non-pointer,
  797. // non-interface field appearing in ForceSendFields will be sent to the
  798. // server regardless of whether the field is empty or not. This may be
  799. // used to include empty fields in Patch requests.
  800. ForceSendFields []string `json:"-"`
  801. // NullFields is a list of field names (e.g. "AdbEnabled") to include in
  802. // API requests with the JSON null value. By default, fields with empty
  803. // values are omitted from API requests. However, any field with an
  804. // empty value appearing in NullFields will be sent to the server as
  805. // null. It is an error if a field in this list has a non-empty value.
  806. // This may be used to include null fields in Patch requests.
  807. NullFields []string `json:"-"`
  808. }
  809. func (s *DeviceSettings) MarshalJSON() ([]byte, error) {
  810. type NoMethod DeviceSettings
  811. raw := NoMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  813. }
  814. // Display: Device display information.
  815. type Display struct {
  816. // Density: Display density expressed as dots-per-inch.
  817. Density int64 `json:"density,omitempty"`
  818. // DisplayId: Unique display id.
  819. DisplayId int64 `json:"displayId,omitempty"`
  820. // Height: Display height in pixels.
  821. Height int64 `json:"height,omitempty"`
  822. // Name: Name of the display.
  823. Name string `json:"name,omitempty"`
  824. // RefreshRate: Refresh rate of the display in frames per second.
  825. RefreshRate int64 `json:"refreshRate,omitempty"`
  826. // State: State of the display.
  827. //
  828. // Possible values:
  829. // "DISPLAY_STATE_UNSPECIFIED" - This value is disallowed.
  830. // "OFF" - Display is off.
  831. // "ON" - Display is on.
  832. // "DOZE" - Display is dozing in a low power state
  833. // "SUSPENDED" - Display is dozing in a suspended low power state.
  834. State string `json:"state,omitempty"`
  835. // Width: Display width in pixels.
  836. Width int64 `json:"width,omitempty"`
  837. // ForceSendFields is a list of field names (e.g. "Density") to
  838. // unconditionally include in API requests. By default, fields with
  839. // empty values are omitted from API requests. However, any non-pointer,
  840. // non-interface field appearing in ForceSendFields will be sent to the
  841. // server regardless of whether the field is empty or not. This may be
  842. // used to include empty fields in Patch requests.
  843. ForceSendFields []string `json:"-"`
  844. // NullFields is a list of field names (e.g. "Density") to include in
  845. // API requests with the JSON null value. By default, fields with empty
  846. // values are omitted from API requests. However, any field with an
  847. // empty value appearing in NullFields will be sent to the server as
  848. // null. It is an error if a field in this list has a non-empty value.
  849. // This may be used to include null fields in Patch requests.
  850. NullFields []string `json:"-"`
  851. }
  852. func (s *Display) MarshalJSON() ([]byte, error) {
  853. type NoMethod Display
  854. raw := NoMethod(*s)
  855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  856. }
  857. // Empty: A generic empty message that you can re-use to avoid defining
  858. // duplicated empty messages in your APIs. A typical example is to use
  859. // it as the request or the response type of an API method. For
  860. // instance:
  861. // service Foo {
  862. // rpc Bar(google.protobuf.Empty) returns
  863. // (google.protobuf.Empty);
  864. // }
  865. // The JSON representation for Empty is empty JSON object {}.
  866. type Empty struct {
  867. // ServerResponse contains the HTTP response code and headers from the
  868. // server.
  869. googleapi.ServerResponse `json:"-"`
  870. }
  871. // EnrollmentToken: An enrollment token.
  872. type EnrollmentToken struct {
  873. // AdditionalData: Optional, arbitrary data associated with the
  874. // enrollment token. This could contain, for example, the ID of an org
  875. // unit the device is assigned to after enrollment. After a device
  876. // enrolls with the token, this data will be exposed in the
  877. // enrollment_token_data field of the Device resource. The data must be
  878. // 1024 characters or less; otherwise, the creation request will fail.
  879. AdditionalData string `json:"additionalData,omitempty"`
  880. // Duration: The length of time the enrollment token is valid, ranging
  881. // from 1 minute to 30 days. If not specified, the default duration is 1
  882. // hour.
  883. Duration string `json:"duration,omitempty"`
  884. // ExpirationTimestamp: The expiration time of the token. This is a
  885. // read-only field generated by the server.
  886. ExpirationTimestamp string `json:"expirationTimestamp,omitempty"`
  887. // Name: The name of the enrollment token, which is generated by the
  888. // server during creation, in the form
  889. // enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}.
  890. Name string `json:"name,omitempty"`
  891. // PolicyName: The name of the policy initially applied to the enrolled
  892. // device, in the form enterprises/{enterpriseId}/policies/{policyId}.
  893. // If not specified, the policy_name for the device’s user is applied.
  894. // If user_name is also not specified,
  895. // enterprises/{enterpriseId}/policies/default is applied by default.
  896. // When updating this field, you can specify only the policyId as long
  897. // as the policyId doesn’t contain any slashes. The rest of the policy
  898. // name will be inferred.
  899. PolicyName string `json:"policyName,omitempty"`
  900. // QrCode: A JSON string whose UTF-8 representation can be used to
  901. // generate a QR code to enroll a device with this enrollment token. To
  902. // enroll a device using NFC, the NFC record must contain a serialized
  903. // java.util.Properties representation of the properties in the JSON.
  904. QrCode string `json:"qrCode,omitempty"`
  905. // Value: The token value that's passed to the device and authorizes the
  906. // device to enroll. This is a read-only field generated by the server.
  907. Value string `json:"value,omitempty"`
  908. // ServerResponse contains the HTTP response code and headers from the
  909. // server.
  910. googleapi.ServerResponse `json:"-"`
  911. // ForceSendFields is a list of field names (e.g. "AdditionalData") to
  912. // unconditionally include in API requests. By default, fields with
  913. // empty values are omitted from API requests. However, any non-pointer,
  914. // non-interface field appearing in ForceSendFields will be sent to the
  915. // server regardless of whether the field is empty or not. This may be
  916. // used to include empty fields in Patch requests.
  917. ForceSendFields []string `json:"-"`
  918. // NullFields is a list of field names (e.g. "AdditionalData") to
  919. // include in API requests with the JSON null value. By default, fields
  920. // with empty values are omitted from API requests. However, any field
  921. // with an empty value appearing in NullFields will be sent to the
  922. // server as null. It is an error if a field in this list has a
  923. // non-empty value. This may be used to include null fields in Patch
  924. // requests.
  925. NullFields []string `json:"-"`
  926. }
  927. func (s *EnrollmentToken) MarshalJSON() ([]byte, error) {
  928. type NoMethod EnrollmentToken
  929. raw := NoMethod(*s)
  930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  931. }
  932. // Enterprise: The configuration applied to an enterprise.
  933. type Enterprise struct {
  934. // AppAutoApprovalEnabled: Deprecated and unused.
  935. AppAutoApprovalEnabled bool `json:"appAutoApprovalEnabled,omitempty"`
  936. // EnabledNotificationTypes: The types of Google Pub/Sub notifications
  937. // enabled for the enterprise.
  938. //
  939. // Possible values:
  940. // "NOTIFICATION_TYPE_UNSPECIFIED" - This value is ignored.
  941. // "ENROLLMENT" - A notification sent when a device enrolls.
  942. // "COMPLIANCE_REPORT" - A notification sent when a device issues a
  943. // policy compliance report. Important: This enum value is deprecated.
  944. // The notification will be sent as STATUS_REPORT.
  945. // "STATUS_REPORT" - A notification sent when a device issues a status
  946. // report.
  947. // "COMMAND" - A notification sent when a device command has
  948. // completed.
  949. EnabledNotificationTypes []string `json:"enabledNotificationTypes,omitempty"`
  950. // EnterpriseDisplayName: The name of the enterprise displayed to users.
  951. EnterpriseDisplayName string `json:"enterpriseDisplayName,omitempty"`
  952. // Logo: An image displayed as a logo during device provisioning.
  953. // Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg,
  954. // image/png, image/webp, image/vnd.wap.wbmp, image/x-adobe-dng.
  955. Logo *ExternalData `json:"logo,omitempty"`
  956. // Name: The name of the enterprise which is generated by the server
  957. // during creation, in the form enterprises/{enterpriseId}.
  958. Name string `json:"name,omitempty"`
  959. // PrimaryColor: A color in RGB format that indicates the predominant
  960. // color to display in the device management app UI. The color
  961. // components are stored as follows: (red << 16) | (green << 8) | blue,
  962. // where the value of each component is between 0 and 255, inclusive.
  963. PrimaryColor int64 `json:"primaryColor,omitempty"`
  964. // PubsubTopic: The topic that Cloud Pub/Sub notifications are published
  965. // to, in the form projects/{project}/topics/{topic}. This field is only
  966. // required if Pub/Sub notifications are enabled.
  967. PubsubTopic string `json:"pubsubTopic,omitempty"`
  968. // TermsAndConditions: Terms and conditions that must be accepted when
  969. // provisioning a device for this enterprise. A page of terms is
  970. // generated for each value in this list.
  971. TermsAndConditions []*TermsAndConditions `json:"termsAndConditions,omitempty"`
  972. // ServerResponse contains the HTTP response code and headers from the
  973. // server.
  974. googleapi.ServerResponse `json:"-"`
  975. // ForceSendFields is a list of field names (e.g.
  976. // "AppAutoApprovalEnabled") to unconditionally include in API requests.
  977. // By default, fields with empty values are omitted from API requests.
  978. // However, any non-pointer, non-interface field appearing in
  979. // ForceSendFields will be sent to the server regardless of whether the
  980. // field is empty or not. This may be used to include empty fields in
  981. // Patch requests.
  982. ForceSendFields []string `json:"-"`
  983. // NullFields is a list of field names (e.g. "AppAutoApprovalEnabled")
  984. // to include in API requests with the JSON null value. By default,
  985. // fields with empty values are omitted from API requests. However, any
  986. // field with an empty value appearing in NullFields will be sent to the
  987. // server as null. It is an error if a field in this list has a
  988. // non-empty value. This may be used to include null fields in Patch
  989. // requests.
  990. NullFields []string `json:"-"`
  991. }
  992. func (s *Enterprise) MarshalJSON() ([]byte, error) {
  993. type NoMethod Enterprise
  994. raw := NoMethod(*s)
  995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  996. }
  997. // ExternalData: Data hosted at an external location. The data is to be
  998. // downloaded by Android Device Policy and verified against the hash.
  999. type ExternalData struct {
  1000. // Sha256Hash: The base-64 encoded SHA-256 hash of the content hosted at
  1001. // url. If the content doesn't match this hash, Android Device Policy
  1002. // won't use the data.
  1003. Sha256Hash string `json:"sha256Hash,omitempty"`
  1004. // Url: The absolute URL to the data, which must use either the http or
  1005. // https scheme. Android Device Policy doesn't provide any credentials
  1006. // in the GET request, so the URL must be publicly accessible. Including
  1007. // a long, random component in the URL may be used to prevent attackers
  1008. // from discovering the URL.
  1009. Url string `json:"url,omitempty"`
  1010. // ForceSendFields is a list of field names (e.g. "Sha256Hash") to
  1011. // unconditionally include in API requests. By default, fields with
  1012. // empty values are omitted from API requests. However, any non-pointer,
  1013. // non-interface field appearing in ForceSendFields will be sent to the
  1014. // server regardless of whether the field is empty or not. This may be
  1015. // used to include empty fields in Patch requests.
  1016. ForceSendFields []string `json:"-"`
  1017. // NullFields is a list of field names (e.g. "Sha256Hash") to include in
  1018. // API requests with the JSON null value. By default, fields with empty
  1019. // values are omitted from API requests. However, any field with an
  1020. // empty value appearing in NullFields will be sent to the server as
  1021. // null. It is an error if a field in this list has a non-empty value.
  1022. // This may be used to include null fields in Patch requests.
  1023. NullFields []string `json:"-"`
  1024. }
  1025. func (s *ExternalData) MarshalJSON() ([]byte, error) {
  1026. type NoMethod ExternalData
  1027. raw := NoMethod(*s)
  1028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1029. }
  1030. // HardwareInfo: Information about device hardware. The fields related
  1031. // to temperature thresholds are only available if hardwareStatusEnabled
  1032. // is true in the device's policy.
  1033. type HardwareInfo struct {
  1034. // BatteryShutdownTemperatures: Battery shutdown temperature thresholds
  1035. // in Celsius for each battery on the device.
  1036. BatteryShutdownTemperatures []float64 `json:"batteryShutdownTemperatures,omitempty"`
  1037. // BatteryThrottlingTemperatures: Battery throttling temperature
  1038. // thresholds in Celsius for each battery on the device.
  1039. BatteryThrottlingTemperatures []float64 `json:"batteryThrottlingTemperatures,omitempty"`
  1040. // Brand: Brand of the device. For example, Google.
  1041. Brand string `json:"brand,omitempty"`
  1042. // CpuShutdownTemperatures: CPU shutdown temperature thresholds in
  1043. // Celsius for each CPU on the device.
  1044. CpuShutdownTemperatures []float64 `json:"cpuShutdownTemperatures,omitempty"`
  1045. // CpuThrottlingTemperatures: CPU throttling temperature thresholds in
  1046. // Celsius for each CPU on the device.
  1047. CpuThrottlingTemperatures []float64 `json:"cpuThrottlingTemperatures,omitempty"`
  1048. // DeviceBasebandVersion: Baseband version. For example,
  1049. // MDM9625_104662.22.05.34p.
  1050. DeviceBasebandVersion string `json:"deviceBasebandVersion,omitempty"`
  1051. // GpuShutdownTemperatures: GPU shutdown temperature thresholds in
  1052. // Celsius for each GPU on the device.
  1053. GpuShutdownTemperatures []float64 `json:"gpuShutdownTemperatures,omitempty"`
  1054. // GpuThrottlingTemperatures: GPU throttling temperature thresholds in
  1055. // Celsius for each GPU on the device.
  1056. GpuThrottlingTemperatures []float64 `json:"gpuThrottlingTemperatures,omitempty"`
  1057. // Hardware: Name of the hardware. For example, Angler.
  1058. Hardware string `json:"hardware,omitempty"`
  1059. // Manufacturer: Manufacturer. For example, Motorola.
  1060. Manufacturer string `json:"manufacturer,omitempty"`
  1061. // Model: The model of the device. For example, Asus Nexus 7.
  1062. Model string `json:"model,omitempty"`
  1063. // SerialNumber: The device serial number.
  1064. SerialNumber string `json:"serialNumber,omitempty"`
  1065. // SkinShutdownTemperatures: Device skin shutdown temperature thresholds
  1066. // in Celsius.
  1067. SkinShutdownTemperatures []float64 `json:"skinShutdownTemperatures,omitempty"`
  1068. // SkinThrottlingTemperatures: Device skin throttling temperature
  1069. // thresholds in Celsius.
  1070. SkinThrottlingTemperatures []float64 `json:"skinThrottlingTemperatures,omitempty"`
  1071. // ForceSendFields is a list of field names (e.g.
  1072. // "BatteryShutdownTemperatures") to unconditionally include in API
  1073. // requests. By default, fields with empty values are omitted from API
  1074. // requests. However, any non-pointer, non-interface field appearing in
  1075. // ForceSendFields will be sent to the server regardless of whether the
  1076. // field is empty or not. This may be used to include empty fields in
  1077. // Patch requests.
  1078. ForceSendFields []string `json:"-"`
  1079. // NullFields is a list of field names (e.g.
  1080. // "BatteryShutdownTemperatures") to include in API requests with the
  1081. // JSON null value. By default, fields with empty values are omitted
  1082. // from API requests. However, any field with an empty value appearing
  1083. // in NullFields will be sent to the server as null. It is an error if a
  1084. // field in this list has a non-empty value. This may be used to include
  1085. // null fields in Patch requests.
  1086. NullFields []string `json:"-"`
  1087. }
  1088. func (s *HardwareInfo) MarshalJSON() ([]byte, error) {
  1089. type NoMethod HardwareInfo
  1090. raw := NoMethod(*s)
  1091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1092. }
  1093. // HardwareStatus: Hardware status. Temperatures may be compared to the
  1094. // temperature thresholds available in hardwareInfo to determine
  1095. // hardware health.
  1096. type HardwareStatus struct {
  1097. // BatteryTemperatures: Current battery temperatures in Celsius for each
  1098. // battery on the device.
  1099. BatteryTemperatures []float64 `json:"batteryTemperatures,omitempty"`
  1100. // CpuTemperatures: Current CPU temperatures in Celsius for each CPU on
  1101. // the device.
  1102. CpuTemperatures []float64 `json:"cpuTemperatures,omitempty"`
  1103. // CpuUsages: CPU usages in percentage for each core available on the
  1104. // device. Usage is 0 for each unplugged core. Empty array implies that
  1105. // CPU usage is not supported in the system.
  1106. CpuUsages []float64 `json:"cpuUsages,omitempty"`
  1107. // CreateTime: The time the measurements were taken.
  1108. CreateTime string `json:"createTime,omitempty"`
  1109. // FanSpeeds: Fan speeds in RPM for each fan on the device. Empty array
  1110. // means that there are no fans or fan speed is not supported on the
  1111. // system.
  1112. FanSpeeds []float64 `json:"fanSpeeds,omitempty"`
  1113. // GpuTemperatures: Current GPU temperatures in Celsius for each GPU on
  1114. // the device.
  1115. GpuTemperatures []float64 `json:"gpuTemperatures,omitempty"`
  1116. // SkinTemperatures: Current device skin temperatures in Celsius.
  1117. SkinTemperatures []float64 `json:"skinTemperatures,omitempty"`
  1118. // ForceSendFields is a list of field names (e.g. "BatteryTemperatures")
  1119. // to unconditionally include in API requests. By default, fields with
  1120. // empty values are omitted from API requests. However, any non-pointer,
  1121. // non-interface field appearing in ForceSendFields will be sent to the
  1122. // server regardless of whether the field is empty or not. This may be
  1123. // used to include empty fields in Patch requests.
  1124. ForceSendFields []string `json:"-"`
  1125. // NullFields is a list of field names (e.g. "BatteryTemperatures") to
  1126. // include in API requests with the JSON null value. By default, fields
  1127. // with empty values are omitted from API requests. However, any field
  1128. // with an empty value appearing in NullFields will be sent to the
  1129. // server as null. It is an error if a field in this list has a
  1130. // non-empty value. This may be used to include null fields in Patch
  1131. // requests.
  1132. NullFields []string `json:"-"`
  1133. }
  1134. func (s *HardwareStatus) MarshalJSON() ([]byte, error) {
  1135. type NoMethod HardwareStatus
  1136. raw := NoMethod(*s)
  1137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1138. }
  1139. // ListDevicesResponse: Response to a request to list devices for a
  1140. // given enterprise.
  1141. type ListDevicesResponse struct {
  1142. // Devices: The list of devices.
  1143. Devices []*Device `json:"devices,omitempty"`
  1144. // NextPageToken: If there are more results, a token to retrieve next
  1145. // page of results.
  1146. NextPageToken string `json:"nextPageToken,omitempty"`
  1147. // ServerResponse contains the HTTP response code and headers from the
  1148. // server.
  1149. googleapi.ServerResponse `json:"-"`
  1150. // ForceSendFields is a list of field names (e.g. "Devices") to
  1151. // unconditionally include in API requests. By default, fields with
  1152. // empty values are omitted from API requests. However, any non-pointer,
  1153. // non-interface field appearing in ForceSendFields will be sent to the
  1154. // server regardless of whether the field is empty or not. This may be
  1155. // used to include empty fields in Patch requests.
  1156. ForceSendFields []string `json:"-"`
  1157. // NullFields is a list of field names (e.g. "Devices") to include in
  1158. // API requests with the JSON null value. By default, fields with empty
  1159. // values are omitted from API requests. However, any field with an
  1160. // empty value appearing in NullFields will be sent to the server as
  1161. // null. It is an error if a field in this list has a non-empty value.
  1162. // This may be used to include null fields in Patch requests.
  1163. NullFields []string `json:"-"`
  1164. }
  1165. func (s *ListDevicesResponse) MarshalJSON() ([]byte, error) {
  1166. type NoMethod ListDevicesResponse
  1167. raw := NoMethod(*s)
  1168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1169. }
  1170. // ListOperationsResponse: The response message for
  1171. // Operations.ListOperations.
  1172. type ListOperationsResponse struct {
  1173. // NextPageToken: The standard List next-page token.
  1174. NextPageToken string `json:"nextPageToken,omitempty"`
  1175. // Operations: A list of operations that matches the specified filter in
  1176. // the request.
  1177. Operations []*Operation `json:"operations,omitempty"`
  1178. // ServerResponse contains the HTTP response code and headers from the
  1179. // server.
  1180. googleapi.ServerResponse `json:"-"`
  1181. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1182. // unconditionally include in API requests. By default, fields with
  1183. // empty values are omitted from API requests. However, any non-pointer,
  1184. // non-interface field appearing in ForceSendFields will be sent to the
  1185. // server regardless of whether the field is empty or not. This may be
  1186. // used to include empty fields in Patch requests.
  1187. ForceSendFields []string `json:"-"`
  1188. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1189. // in API requests with the JSON null value. By default, fields with
  1190. // empty values are omitted from API requests. However, any field with
  1191. // an empty value appearing in NullFields will be sent to the server as
  1192. // null. It is an error if a field in this list has a non-empty value.
  1193. // This may be used to include null fields in Patch requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1197. type NoMethod ListOperationsResponse
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // ListPoliciesResponse: Response to a request to list policies for a
  1202. // given enterprise.
  1203. type ListPoliciesResponse struct {
  1204. // NextPageToken: If there are more results, a token to retrieve next
  1205. // page of results.
  1206. NextPageToken string `json:"nextPageToken,omitempty"`
  1207. // Policies: The list of policies.
  1208. Policies []*Policy `json:"policies,omitempty"`
  1209. // ServerResponse contains the HTTP response code and headers from the
  1210. // server.
  1211. googleapi.ServerResponse `json:"-"`
  1212. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1213. // unconditionally include in API requests. By default, fields with
  1214. // empty values are omitted from API requests. However, any non-pointer,
  1215. // non-interface field appearing in ForceSendFields will be sent to the
  1216. // server regardless of whether the field is empty or not. This may be
  1217. // used to include empty fields in Patch requests.
  1218. ForceSendFields []string `json:"-"`
  1219. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1220. // in API requests with the JSON null value. By default, fields with
  1221. // empty values are omitted from API requests. However, any field with
  1222. // an empty value appearing in NullFields will be sent to the server as
  1223. // null. It is an error if a field in this list has a non-empty value.
  1224. // This may be used to include null fields in Patch requests.
  1225. NullFields []string `json:"-"`
  1226. }
  1227. func (s *ListPoliciesResponse) MarshalJSON() ([]byte, error) {
  1228. type NoMethod ListPoliciesResponse
  1229. raw := NoMethod(*s)
  1230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1231. }
  1232. // ManagedProperty: Managed property.
  1233. type ManagedProperty struct {
  1234. // DefaultValue: The default value of the property. BUNDLE_ARRAY
  1235. // properties don't have a default value.
  1236. DefaultValue interface{} `json:"defaultValue,omitempty"`
  1237. // Description: A longer description of the property, providing more
  1238. // detail of what it affects. Localized.
  1239. Description string `json:"description,omitempty"`
  1240. // Entries: For CHOICE or MULTISELECT properties, the list of possible
  1241. // entries.
  1242. Entries []*ManagedPropertyEntry `json:"entries,omitempty"`
  1243. // Key: The unique key that the app uses to identify the property, e.g.
  1244. // "com.google.android.gm.fieldname".
  1245. Key string `json:"key,omitempty"`
  1246. // NestedProperties: For BUNDLE_ARRAY properties, the list of nested
  1247. // properties. A BUNDLE_ARRAY property is at most two levels deep.
  1248. NestedProperties []*ManagedProperty `json:"nestedProperties,omitempty"`
  1249. // Title: The name of the property. Localized.
  1250. Title string `json:"title,omitempty"`
  1251. // Type: The type of the property.
  1252. //
  1253. // Possible values:
  1254. // "MANAGED_PROPERTY_TYPE_UNSPECIFIED" - Not used.
  1255. // "BOOL" - A property of boolean type.
  1256. // "STRING" - A property of string type.
  1257. // "INTEGER" - A property of integer type.
  1258. // "CHOICE" - A choice of one item from a set.
  1259. // "MULTISELECT" - A choice of multiple items from a set.
  1260. // "HIDDEN" - A hidden restriction of string type (the default value
  1261. // can be used to pass along information that can't be modified, such as
  1262. // a version code).
  1263. // "BUNDLE_ARRAY" - An array of property bundles.
  1264. Type string `json:"type,omitempty"`
  1265. // ForceSendFields is a list of field names (e.g. "DefaultValue") to
  1266. // unconditionally include in API requests. By default, fields with
  1267. // empty values are omitted from API requests. However, any non-pointer,
  1268. // non-interface field appearing in ForceSendFields will be sent to the
  1269. // server regardless of whether the field is empty or not. This may be
  1270. // used to include empty fields in Patch requests.
  1271. ForceSendFields []string `json:"-"`
  1272. // NullFields is a list of field names (e.g. "DefaultValue") to include
  1273. // in API requests with the JSON null value. By default, fields with
  1274. // empty values are omitted from API requests. However, any field with
  1275. // an empty value appearing in NullFields will be sent to the server as
  1276. // null. It is an error if a field in this list has a non-empty value.
  1277. // This may be used to include null fields in Patch requests.
  1278. NullFields []string `json:"-"`
  1279. }
  1280. func (s *ManagedProperty) MarshalJSON() ([]byte, error) {
  1281. type NoMethod ManagedProperty
  1282. raw := NoMethod(*s)
  1283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1284. }
  1285. // ManagedPropertyEntry: An entry of a managed property.
  1286. type ManagedPropertyEntry struct {
  1287. // Name: The human-readable name of the value. Localized.
  1288. Name string `json:"name,omitempty"`
  1289. // Value: The machine-readable value of the entry, which should be used
  1290. // in the configuration. Not localized.
  1291. Value string `json:"value,omitempty"`
  1292. // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") to include in API
  1300. // 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 *ManagedPropertyEntry) MarshalJSON() ([]byte, error) {
  1308. type NoMethod ManagedPropertyEntry
  1309. raw := NoMethod(*s)
  1310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1311. }
  1312. // MemoryEvent: An event related to memory and storage measurements.
  1313. type MemoryEvent struct {
  1314. // ByteCount: The number of free bytes in the medium, or for
  1315. // EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage
  1316. // medium.
  1317. ByteCount int64 `json:"byteCount,omitempty,string"`
  1318. // CreateTime: The creation time of the event.
  1319. CreateTime string `json:"createTime,omitempty"`
  1320. // EventType: Event type.
  1321. //
  1322. // Possible values:
  1323. // "MEMORY_EVENT_TYPE_UNSPECIFIED" - Unspecified. No events have this
  1324. // type.
  1325. // "RAM_MEASURED" - Free space in RAM was measured.
  1326. // "INTERNAL_STORAGE_MEASURED" - Free space in internal storage was
  1327. // measured.
  1328. // "EXTERNAL_STORAGE_DETECTED" - A new external storage medium was
  1329. // detected. The reported byte count is the total capacity of the
  1330. // storage medium.
  1331. // "EXTERNAL_STORAGE_REMOVED" - An external storage medium was
  1332. // removed. The reported byte count is zero.
  1333. // "EXTERNAL_STORAGE_MEASURED" - Free space in an external storage
  1334. // medium was measured.
  1335. EventType string `json:"eventType,omitempty"`
  1336. // ForceSendFields is a list of field names (e.g. "ByteCount") to
  1337. // unconditionally include in API requests. By default, fields with
  1338. // empty values are omitted from API requests. However, any non-pointer,
  1339. // non-interface field appearing in ForceSendFields will be sent to the
  1340. // server regardless of whether the field is empty or not. This may be
  1341. // used to include empty fields in Patch requests.
  1342. ForceSendFields []string `json:"-"`
  1343. // NullFields is a list of field names (e.g. "ByteCount") to include in
  1344. // API requests with the JSON null value. By default, fields with empty
  1345. // values are omitted from API requests. However, any field with an
  1346. // empty value appearing in NullFields will be sent to the server as
  1347. // null. It is an error if a field in this list has a non-empty value.
  1348. // This may be used to include null fields in Patch requests.
  1349. NullFields []string `json:"-"`
  1350. }
  1351. func (s *MemoryEvent) MarshalJSON() ([]byte, error) {
  1352. type NoMethod MemoryEvent
  1353. raw := NoMethod(*s)
  1354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1355. }
  1356. // MemoryInfo: Information about device memory and storage.
  1357. type MemoryInfo struct {
  1358. // TotalInternalStorage: Total internal storage on device in bytes.
  1359. TotalInternalStorage int64 `json:"totalInternalStorage,omitempty,string"`
  1360. // TotalRam: Total RAM on device in bytes.
  1361. TotalRam int64 `json:"totalRam,omitempty,string"`
  1362. // ForceSendFields is a list of field names (e.g.
  1363. // "TotalInternalStorage") to unconditionally include in API requests.
  1364. // By default, fields with empty values are omitted from API requests.
  1365. // However, any non-pointer, non-interface field appearing in
  1366. // ForceSendFields will be sent to the server regardless of whether the
  1367. // field is empty or not. This may be used to include empty fields in
  1368. // Patch requests.
  1369. ForceSendFields []string `json:"-"`
  1370. // NullFields is a list of field names (e.g. "TotalInternalStorage") to
  1371. // include in API requests with the JSON null value. By default, fields
  1372. // with empty values are omitted from API requests. However, any field
  1373. // with an empty value appearing in NullFields will be sent to the
  1374. // server as null. It is an error if a field in this list has a
  1375. // non-empty value. This may be used to include null fields in Patch
  1376. // requests.
  1377. NullFields []string `json:"-"`
  1378. }
  1379. func (s *MemoryInfo) MarshalJSON() ([]byte, error) {
  1380. type NoMethod MemoryInfo
  1381. raw := NoMethod(*s)
  1382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1383. }
  1384. // NetworkInfo: Device network info.
  1385. type NetworkInfo struct {
  1386. // Imei: IMEI number of the GSM device. For example, A1000031212.
  1387. Imei string `json:"imei,omitempty"`
  1388. // Meid: MEID number of the CDMA device. For example, A00000292788E1.
  1389. Meid string `json:"meid,omitempty"`
  1390. // NetworkOperatorName: Alphabetic name of current registered operator.
  1391. // For example, Vodafone.
  1392. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  1393. // WifiMacAddress: Wi-Fi MAC address of the device. For example,
  1394. // 7c:11:11:11:11:11.
  1395. WifiMacAddress string `json:"wifiMacAddress,omitempty"`
  1396. // ForceSendFields is a list of field names (e.g. "Imei") to
  1397. // unconditionally include in API requests. By default, fields with
  1398. // empty values are omitted from API requests. However, any non-pointer,
  1399. // non-interface field appearing in ForceSendFields will be sent to the
  1400. // server regardless of whether the field is empty or not. This may be
  1401. // used to include empty fields in Patch requests.
  1402. ForceSendFields []string `json:"-"`
  1403. // NullFields is a list of field names (e.g. "Imei") to include in API
  1404. // requests with the JSON null value. By default, fields with empty
  1405. // values are omitted from API requests. However, any field with an
  1406. // empty value appearing in NullFields will be sent to the server as
  1407. // null. It is an error if a field in this list has a non-empty value.
  1408. // This may be used to include null fields in Patch requests.
  1409. NullFields []string `json:"-"`
  1410. }
  1411. func (s *NetworkInfo) MarshalJSON() ([]byte, error) {
  1412. type NoMethod NetworkInfo
  1413. raw := NoMethod(*s)
  1414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1415. }
  1416. // NonComplianceDetail: Provides detail about non-compliance with a
  1417. // policy setting.
  1418. type NonComplianceDetail struct {
  1419. // CurrentValue: If the policy setting could not be applied, the current
  1420. // value of the setting on the device.
  1421. CurrentValue interface{} `json:"currentValue,omitempty"`
  1422. // FieldPath: For settings with nested fields, if a particular nested
  1423. // field is out of compliance, this specifies the full path to the
  1424. // offending field. The path is formatted in the same way the policy
  1425. // JSON field would be referenced in JavaScript, that is: 1) For
  1426. // object-typed fields, the field name is followed by a dot then by a
  1427. // subfield name. 2) For array-typed fields, the field name is followed
  1428. // by the array index enclosed in brackets. For example, to indicate a
  1429. // problem with the url field in the externalData field in the 3rd
  1430. // application, the path would be applications[2].externalData.url
  1431. FieldPath string `json:"fieldPath,omitempty"`
  1432. // InstallationFailureReason: If package_name is set and the
  1433. // non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the
  1434. // detailed reason the app can't be installed or updated.
  1435. //
  1436. // Possible values:
  1437. // "INSTALLATION_FAILURE_REASON_UNSPECIFIED" - This value is
  1438. // disallowed.
  1439. // "INSTALLATION_FAILURE_REASON_UNKNOWN" - An unknown condition is
  1440. // preventing the app from being installed. Some potential reasons are
  1441. // that the device doesn't have enough storage, the device network
  1442. // connection is unreliable, or the installation is taking longer than
  1443. // expected. The installation will be retried automatically.
  1444. // "IN_PROGRESS" - The installation is still in progress.
  1445. // "NOT_FOUND" - The app was not found in Play.
  1446. // "NOT_COMPATIBLE_WITH_DEVICE" - The app is incompatible with the
  1447. // device.
  1448. // "NOT_APPROVED" - The app has not been approved by the admin.
  1449. // "PERMISSIONS_NOT_ACCEPTED" - The app has new permissions that have
  1450. // not been accepted by the admin.
  1451. // "NOT_AVAILABLE_IN_COUNTRY" - The app is not available in the user's
  1452. // country.
  1453. // "NO_LICENSES_REMAINING" - There are no licenses available to assign
  1454. // to the user.
  1455. // "NOT_ENROLLED" - The enterprise is no longer enrolled with managed
  1456. // Play or Android Device Policy is not enabled for the enterprise.
  1457. // "USER_INVALID" - The user is no longer valid. The user may have
  1458. // been deleted or disabled.
  1459. InstallationFailureReason string `json:"installationFailureReason,omitempty"`
  1460. // NonComplianceReason: The reason the device is not in compliance with
  1461. // the setting.
  1462. //
  1463. // Possible values:
  1464. // "NON_COMPLIANCE_REASON_UNSPECIFIED" - This value is disallowed.
  1465. // "API_LEVEL" - The setting is not supported in the API level of the
  1466. // Android version running on the device.
  1467. // "MANAGEMENT_MODE" - The management mode (profile owner, device
  1468. // owner, etc.) doesn't support the setting.
  1469. // "USER_ACTION" - The user has not taken required action to comply
  1470. // with the setting.
  1471. // "INVALID_VALUE" - The setting has an invalid value.
  1472. // "APP_NOT_INSTALLED" - The app required to implement the policy is
  1473. // not installed.
  1474. // "UNSUPPORTED" - The policy is not supported by the version of
  1475. // Android Device Policy on the device.
  1476. // "APP_INSTALLED" - A blocked app is installed.
  1477. // "PENDING" - The setting hasn't been applied at the time of the
  1478. // report, but is expected to be applied shortly.
  1479. // "APP_INCOMPATIBLE" - The setting can't be applied to the app
  1480. // because the app doesn't support it, for example because its target
  1481. // SDK version is not high enough.
  1482. // "APP_NOT_UPDATED" - The app is installed, but it hasn't been
  1483. // updated to the minimum version code specified by policy.
  1484. NonComplianceReason string `json:"nonComplianceReason,omitempty"`
  1485. // PackageName: The package name indicating which app is out of
  1486. // compliance, if applicable.
  1487. PackageName string `json:"packageName,omitempty"`
  1488. // SettingName: The name of the policy setting. This is the JSON field
  1489. // name of a top-level Policy field.
  1490. SettingName string `json:"settingName,omitempty"`
  1491. // ForceSendFields is a list of field names (e.g. "CurrentValue") to
  1492. // unconditionally include in API requests. By default, fields with
  1493. // empty values are omitted from API requests. However, any non-pointer,
  1494. // non-interface field appearing in ForceSendFields will be sent to the
  1495. // server regardless of whether the field is empty or not. This may be
  1496. // used to include empty fields in Patch requests.
  1497. ForceSendFields []string `json:"-"`
  1498. // NullFields is a list of field names (e.g. "CurrentValue") to include
  1499. // in API requests with the JSON null value. By default, fields with
  1500. // empty values are omitted from API requests. However, any field with
  1501. // an empty value appearing in NullFields will be sent to the server as
  1502. // null. It is an error if a field in this list has a non-empty value.
  1503. // This may be used to include null fields in Patch requests.
  1504. NullFields []string `json:"-"`
  1505. }
  1506. func (s *NonComplianceDetail) MarshalJSON() ([]byte, error) {
  1507. type NoMethod NonComplianceDetail
  1508. raw := NoMethod(*s)
  1509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1510. }
  1511. // NonComplianceDetailCondition: A compliance rule condition which is
  1512. // satisfied if there exists any matching NonComplianceDetail for the
  1513. // device. A NonComplianceDetail matches a NonComplianceDetailCondition
  1514. // if all the fields which are set within the
  1515. // NonComplianceDetailCondition match the corresponding
  1516. // NonComplianceDetail fields.
  1517. type NonComplianceDetailCondition struct {
  1518. // NonComplianceReason: The reason the device is not in compliance with
  1519. // the setting. If not set, then this condition matches any reason.
  1520. //
  1521. // Possible values:
  1522. // "NON_COMPLIANCE_REASON_UNSPECIFIED" - This value is disallowed.
  1523. // "API_LEVEL" - The setting is not supported in the API level of the
  1524. // Android version running on the device.
  1525. // "MANAGEMENT_MODE" - The management mode (profile owner, device
  1526. // owner, etc.) doesn't support the setting.
  1527. // "USER_ACTION" - The user has not taken required action to comply
  1528. // with the setting.
  1529. // "INVALID_VALUE" - The setting has an invalid value.
  1530. // "APP_NOT_INSTALLED" - The app required to implement the policy is
  1531. // not installed.
  1532. // "UNSUPPORTED" - The policy is not supported by the version of
  1533. // Android Device Policy on the device.
  1534. // "APP_INSTALLED" - A blocked app is installed.
  1535. // "PENDING" - The setting hasn't been applied at the time of the
  1536. // report, but is expected to be applied shortly.
  1537. // "APP_INCOMPATIBLE" - The setting can't be applied to the app
  1538. // because the app doesn't support it, for example because its target
  1539. // SDK version is not high enough.
  1540. // "APP_NOT_UPDATED" - The app is installed, but it hasn't been
  1541. // updated to the minimum version code specified by policy.
  1542. NonComplianceReason string `json:"nonComplianceReason,omitempty"`
  1543. // PackageName: The package name of the app that's out of compliance. If
  1544. // not set, then this condition matches any package name.
  1545. PackageName string `json:"packageName,omitempty"`
  1546. // SettingName: The name of the policy setting. This is the JSON field
  1547. // name of a top-level Policy field. If not set, then this condition
  1548. // matches any setting name.
  1549. SettingName string `json:"settingName,omitempty"`
  1550. // ForceSendFields is a list of field names (e.g. "NonComplianceReason")
  1551. // to unconditionally include in API requests. By default, fields with
  1552. // empty values are omitted from API requests. However, any non-pointer,
  1553. // non-interface field appearing in ForceSendFields will be sent to the
  1554. // server regardless of whether the field is empty or not. This may be
  1555. // used to include empty fields in Patch requests.
  1556. ForceSendFields []string `json:"-"`
  1557. // NullFields is a list of field names (e.g. "NonComplianceReason") to
  1558. // include in API requests with the JSON null value. By default, fields
  1559. // with empty values are omitted from API requests. However, any field
  1560. // with an empty value appearing in NullFields will be sent to the
  1561. // server as null. It is an error if a field in this list has a
  1562. // non-empty value. This may be used to include null fields in Patch
  1563. // requests.
  1564. NullFields []string `json:"-"`
  1565. }
  1566. func (s *NonComplianceDetailCondition) MarshalJSON() ([]byte, error) {
  1567. type NoMethod NonComplianceDetailCondition
  1568. raw := NoMethod(*s)
  1569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1570. }
  1571. // Operation: This resource represents a long-running operation that is
  1572. // the result of a network API call.
  1573. type Operation struct {
  1574. // Done: If the value is false, it means the operation is still in
  1575. // progress. If true, the operation is completed, and either error or
  1576. // response is available.
  1577. Done bool `json:"done,omitempty"`
  1578. // Error: The error result of the operation in case of failure or
  1579. // cancellation.
  1580. Error *Status `json:"error,omitempty"`
  1581. // Metadata: Service-specific metadata associated with the operation. It
  1582. // typically contains progress information and common metadata such as
  1583. // create time. Some services might not provide such metadata. Any
  1584. // method that returns a long-running operation should document the
  1585. // metadata type, if any.
  1586. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1587. // Name: The server-assigned name, which is only unique within the same
  1588. // service that originally returns it. If you use the default HTTP
  1589. // mapping, the name should have the format of
  1590. // operations/some/unique/name.
  1591. Name string `json:"name,omitempty"`
  1592. // Response: The normal response of the operation in case of success. If
  1593. // the original method returns no data on success, such as Delete, the
  1594. // response is google.protobuf.Empty. If the original method is standard
  1595. // Get/Create/Update, the response should be the resource. For other
  1596. // methods, the response should have the type XxxResponse, where Xxx is
  1597. // the original method name. For example, if the original method name is
  1598. // TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
  1599. Response googleapi.RawMessage `json:"response,omitempty"`
  1600. // ServerResponse contains the HTTP response code and headers from the
  1601. // server.
  1602. googleapi.ServerResponse `json:"-"`
  1603. // ForceSendFields is a list of field names (e.g. "Done") to
  1604. // unconditionally include in API requests. By default, fields with
  1605. // empty values are omitted from API requests. However, any non-pointer,
  1606. // non-interface field appearing in ForceSendFields will be sent to the
  1607. // server regardless of whether the field is empty or not. This may be
  1608. // used to include empty fields in Patch requests.
  1609. ForceSendFields []string `json:"-"`
  1610. // NullFields is a list of field names (e.g. "Done") to include in API
  1611. // requests with the JSON null value. By default, fields with empty
  1612. // values are omitted from API requests. However, any field with an
  1613. // empty value appearing in NullFields will be sent to the server as
  1614. // null. It is an error if a field in this list has a non-empty value.
  1615. // This may be used to include null fields in Patch requests.
  1616. NullFields []string `json:"-"`
  1617. }
  1618. func (s *Operation) MarshalJSON() ([]byte, error) {
  1619. type NoMethod Operation
  1620. raw := NoMethod(*s)
  1621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1622. }
  1623. // PackageNameList: A list of package names.
  1624. type PackageNameList struct {
  1625. // PackageNames: A list of package names.
  1626. PackageNames []string `json:"packageNames,omitempty"`
  1627. // ForceSendFields is a list of field names (e.g. "PackageNames") to
  1628. // unconditionally include in API requests. By default, fields with
  1629. // empty values are omitted from API requests. However, any non-pointer,
  1630. // non-interface field appearing in ForceSendFields will be sent to the
  1631. // server regardless of whether the field is empty or not. This may be
  1632. // used to include empty fields in Patch requests.
  1633. ForceSendFields []string `json:"-"`
  1634. // NullFields is a list of field names (e.g. "PackageNames") to include
  1635. // in API requests with the JSON null value. By default, fields with
  1636. // empty values are omitted from API requests. However, any field with
  1637. // an empty value appearing in NullFields will be sent to the server as
  1638. // null. It is an error if a field in this list has a non-empty value.
  1639. // This may be used to include null fields in Patch requests.
  1640. NullFields []string `json:"-"`
  1641. }
  1642. func (s *PackageNameList) MarshalJSON() ([]byte, error) {
  1643. type NoMethod PackageNameList
  1644. raw := NoMethod(*s)
  1645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1646. }
  1647. // PasswordRequirements: Requirements for the password used to unlock a
  1648. // device.
  1649. type PasswordRequirements struct {
  1650. // MaximumFailedPasswordsForWipe: Number of incorrect device-unlock
  1651. // passwords that can be entered before a device is wiped. A value of 0
  1652. // means there is no restriction.
  1653. MaximumFailedPasswordsForWipe int64 `json:"maximumFailedPasswordsForWipe,omitempty"`
  1654. // PasswordExpirationTimeout: Password expiration timeout.
  1655. PasswordExpirationTimeout string `json:"passwordExpirationTimeout,omitempty"`
  1656. // PasswordHistoryLength: The length of the password history. After
  1657. // setting this field, the user won't be able to enter a new password
  1658. // that is the same as any password in the history. A value of 0 means
  1659. // there is no restriction.
  1660. PasswordHistoryLength int64 `json:"passwordHistoryLength,omitempty"`
  1661. // PasswordMinimumLength: The minimum allowed password length. A value
  1662. // of 0 means there is no restriction. Only enforced when
  1663. // password_quality is NUMERIC, NUMERIC_COMPLEX, ALPHABETIC,
  1664. // ALPHANUMERIC, or COMPLEX.
  1665. PasswordMinimumLength int64 `json:"passwordMinimumLength,omitempty"`
  1666. // PasswordMinimumLetters: Minimum number of letters required in the
  1667. // password. Only enforced when password_quality is COMPLEX.
  1668. PasswordMinimumLetters int64 `json:"passwordMinimumLetters,omitempty"`
  1669. // PasswordMinimumLowerCase: Minimum number of lower case letters
  1670. // required in the password. Only enforced when password_quality is
  1671. // COMPLEX.
  1672. PasswordMinimumLowerCase int64 `json:"passwordMinimumLowerCase,omitempty"`
  1673. // PasswordMinimumNonLetter: Minimum number of non-letter characters
  1674. // (numerical digits or symbols) required in the password. Only enforced
  1675. // when password_quality is COMPLEX.
  1676. PasswordMinimumNonLetter int64 `json:"passwordMinimumNonLetter,omitempty"`
  1677. // PasswordMinimumNumeric: Minimum number of numerical digits required
  1678. // in the password. Only enforced when password_quality is COMPLEX.
  1679. PasswordMinimumNumeric int64 `json:"passwordMinimumNumeric,omitempty"`
  1680. // PasswordMinimumSymbols: Minimum number of symbols required in the
  1681. // password. Only enforced when password_quality is COMPLEX.
  1682. PasswordMinimumSymbols int64 `json:"passwordMinimumSymbols,omitempty"`
  1683. // PasswordMinimumUpperCase: Minimum number of upper case letters
  1684. // required in the password. Only enforced when password_quality is
  1685. // COMPLEX.
  1686. PasswordMinimumUpperCase int64 `json:"passwordMinimumUpperCase,omitempty"`
  1687. // PasswordQuality: The required password quality.
  1688. //
  1689. // Possible values:
  1690. // "PASSWORD_QUALITY_UNSPECIFIED" - There are no password
  1691. // requirements.
  1692. // "BIOMETRIC_WEAK" - The device must be secured with a low-security
  1693. // biometric recognition technology, at minimum. This includes
  1694. // technologies that can recognize the identity of an individual that
  1695. // are roughly equivalent to a 3-digit PIN (false detection is less than
  1696. // 1 in 1,000).
  1697. // "SOMETHING" - A password is required, but there are no restrictions
  1698. // on what the password must contain.
  1699. // "NUMERIC" - The password must contain numeric characters.
  1700. // "NUMERIC_COMPLEX" - The password must contain numeric characters
  1701. // with no repeating (4444) or ordered (1234, 4321, 2468) sequences.
  1702. // "ALPHABETIC" - The password must contain alphabetic (or symbol)
  1703. // characters.
  1704. // "ALPHANUMERIC" - The password must contain both numeric and
  1705. // alphabetic (or symbol) characters.
  1706. // "COMPLEX" - The password must contain at least a letter, a
  1707. // numerical digit and a special symbol. Other password constraints, for
  1708. // example, password_minimum_letters are enforced.
  1709. PasswordQuality string `json:"passwordQuality,omitempty"`
  1710. // ForceSendFields is a list of field names (e.g.
  1711. // "MaximumFailedPasswordsForWipe") to unconditionally include in API
  1712. // requests. By default, fields with empty values are omitted from API
  1713. // requests. However, any non-pointer, non-interface field appearing in
  1714. // ForceSendFields will be sent to the server regardless of whether the
  1715. // field is empty or not. This may be used to include empty fields in
  1716. // Patch requests.
  1717. ForceSendFields []string `json:"-"`
  1718. // NullFields is a list of field names (e.g.
  1719. // "MaximumFailedPasswordsForWipe") to include in API requests with the
  1720. // JSON null value. By default, fields with empty values are omitted
  1721. // from API requests. However, any field with an empty value appearing
  1722. // in NullFields will be sent to the server as null. It is an error if a
  1723. // field in this list has a non-empty value. This may be used to include
  1724. // null fields in Patch requests.
  1725. NullFields []string `json:"-"`
  1726. }
  1727. func (s *PasswordRequirements) MarshalJSON() ([]byte, error) {
  1728. type NoMethod PasswordRequirements
  1729. raw := NoMethod(*s)
  1730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1731. }
  1732. // PermissionGrant: Configuration for an Android permission and its
  1733. // grant state.
  1734. type PermissionGrant struct {
  1735. // Permission: The android permission or group, e.g.
  1736. // android.permission.READ_CALENDAR or
  1737. // android.permission_group.CALENDAR.
  1738. Permission string `json:"permission,omitempty"`
  1739. // Policy: The policy for granting the permission.
  1740. //
  1741. // Possible values:
  1742. // "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no
  1743. // policy is specified for a permission at any level, then the PROMPT
  1744. // behavior is used by default.
  1745. // "PROMPT" - Prompt the user to grant a permission.
  1746. // "GRANT" - Automatically grant a permission.
  1747. // "DENY" - Automatically deny a permission.
  1748. Policy string `json:"policy,omitempty"`
  1749. // ForceSendFields is a list of field names (e.g. "Permission") to
  1750. // unconditionally include in API requests. By default, fields with
  1751. // empty values are omitted from API requests. However, any non-pointer,
  1752. // non-interface field appearing in ForceSendFields will be sent to the
  1753. // server regardless of whether the field is empty or not. This may be
  1754. // used to include empty fields in Patch requests.
  1755. ForceSendFields []string `json:"-"`
  1756. // NullFields is a list of field names (e.g. "Permission") to include in
  1757. // API requests with the JSON null value. By default, fields with empty
  1758. // values are omitted from API requests. However, any field with an
  1759. // empty value appearing in NullFields will be sent to the server as
  1760. // null. It is an error if a field in this list has a non-empty value.
  1761. // This may be used to include null fields in Patch requests.
  1762. NullFields []string `json:"-"`
  1763. }
  1764. func (s *PermissionGrant) MarshalJSON() ([]byte, error) {
  1765. type NoMethod PermissionGrant
  1766. raw := NoMethod(*s)
  1767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1768. }
  1769. // PersistentPreferredActivity: A default activity for handling intents
  1770. // that match a particular intent filter.
  1771. type PersistentPreferredActivity struct {
  1772. // Actions: The intent actions to match in the filter. If any actions
  1773. // are included in the filter, then an intent's action must be one of
  1774. // those values for it to match. If no actions are included, the intent
  1775. // action is ignored.
  1776. Actions []string `json:"actions,omitempty"`
  1777. // Categories: The intent categories to match in the filter. An intent
  1778. // includes the categories that it requires, all of which must be
  1779. // included in the filter in order to match. In other words, adding a
  1780. // category to the filter has no impact on matching unless that category
  1781. // is specified in the intent.
  1782. Categories []string `json:"categories,omitempty"`
  1783. // ReceiverActivity: The activity that should be the default intent
  1784. // handler. This should be an Android component name, e.g.
  1785. // com.android.enterprise.app/.MainActivity. Alternatively, the value
  1786. // may be the package name of an app, which causes Android Device Policy
  1787. // to choose an appropriate activity from the app to handle the intent.
  1788. ReceiverActivity string `json:"receiverActivity,omitempty"`
  1789. // ForceSendFields is a list of field names (e.g. "Actions") to
  1790. // unconditionally include in API requests. By default, fields with
  1791. // empty values are omitted from API requests. However, any non-pointer,
  1792. // non-interface field appearing in ForceSendFields will be sent to the
  1793. // server regardless of whether the field is empty or not. This may be
  1794. // used to include empty fields in Patch requests.
  1795. ForceSendFields []string `json:"-"`
  1796. // NullFields is a list of field names (e.g. "Actions") to include in
  1797. // API requests with the JSON null value. By default, fields with empty
  1798. // values are omitted from API requests. However, any field with an
  1799. // empty value appearing in NullFields will be sent to the server as
  1800. // null. It is an error if a field in this list has a non-empty value.
  1801. // This may be used to include null fields in Patch requests.
  1802. NullFields []string `json:"-"`
  1803. }
  1804. func (s *PersistentPreferredActivity) MarshalJSON() ([]byte, error) {
  1805. type NoMethod PersistentPreferredActivity
  1806. raw := NoMethod(*s)
  1807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1808. }
  1809. // Policy: A policy resources represents a group settings that govern
  1810. // the behavior of a managed device and the apps installed on it.
  1811. type Policy struct {
  1812. // AccountTypesWithManagementDisabled: Account types that can't be
  1813. // managed by the user.
  1814. AccountTypesWithManagementDisabled []string `json:"accountTypesWithManagementDisabled,omitempty"`
  1815. // AddUserDisabled: Whether adding new users and profiles is disabled.
  1816. AddUserDisabled bool `json:"addUserDisabled,omitempty"`
  1817. // AdjustVolumeDisabled: Whether adjusting the master volume is
  1818. // disabled.
  1819. AdjustVolumeDisabled bool `json:"adjustVolumeDisabled,omitempty"`
  1820. // AlwaysOnVpnPackage: Configuration for an always-on VPN connection.
  1821. // Use with vpn_config_disabled to prevent modification of this setting.
  1822. AlwaysOnVpnPackage *AlwaysOnVpnPackage `json:"alwaysOnVpnPackage,omitempty"`
  1823. // AndroidDevicePolicyTracks: The app tracks for Android Device Policy
  1824. // the device can access. The device receives the latest version among
  1825. // all accessible tracks. If no tracks are specified, then the device
  1826. // only uses the production track.
  1827. //
  1828. // Possible values:
  1829. // "APP_TRACK_UNSPECIFIED" - This value is ignored.
  1830. // "PRODUCTION" - The production track, which provides the latest
  1831. // stable release.
  1832. // "BETA" - The beta track, which provides the latest beta release.
  1833. AndroidDevicePolicyTracks []string `json:"androidDevicePolicyTracks,omitempty"`
  1834. // AppAutoUpdatePolicy: The app auto update policy, which controls when
  1835. // automatic app updates can be applied.
  1836. //
  1837. // Possible values:
  1838. // "APP_AUTO_UPDATE_POLICY_UNSPECIFIED" - The auto-update policy is
  1839. // not set. Equivalent to CHOICE_TO_THE_USER.
  1840. // "CHOICE_TO_THE_USER" - The user can control auto-updates.
  1841. // "NEVER" - Apps are never auto-updated.
  1842. // "WIFI_ONLY" - Apps are auto-updated over Wi-Fi only.
  1843. // "ALWAYS" - Apps are auto-updated at any time. Data charges may
  1844. // apply.
  1845. AppAutoUpdatePolicy string `json:"appAutoUpdatePolicy,omitempty"`
  1846. // Applications: Policy applied to apps.
  1847. Applications []*ApplicationPolicy `json:"applications,omitempty"`
  1848. // AutoTimeRequired: Whether auto time is required, which prevents the
  1849. // user from manually setting the date and time.
  1850. AutoTimeRequired bool `json:"autoTimeRequired,omitempty"`
  1851. // BlockApplicationsEnabled: Whether applications other than the ones
  1852. // configured in applications are blocked from being installed. When
  1853. // set, applications that were installed under a previous policy but no
  1854. // longer appear in the policy are automatically uninstalled.
  1855. BlockApplicationsEnabled bool `json:"blockApplicationsEnabled,omitempty"`
  1856. // BluetoothConfigDisabled: Whether configuring bluetooth is disabled.
  1857. BluetoothConfigDisabled bool `json:"bluetoothConfigDisabled,omitempty"`
  1858. // BluetoothContactSharingDisabled: Whether bluetooth contact sharing is
  1859. // disabled.
  1860. BluetoothContactSharingDisabled bool `json:"bluetoothContactSharingDisabled,omitempty"`
  1861. // BluetoothDisabled: Whether bluetooth is disabled. Prefer this setting
  1862. // over bluetooth_config_disabled because bluetooth_config_disabled can
  1863. // be bypassed by the user.
  1864. BluetoothDisabled bool `json:"bluetoothDisabled,omitempty"`
  1865. // CameraDisabled: Whether all cameras on the device are disabled.
  1866. CameraDisabled bool `json:"cameraDisabled,omitempty"`
  1867. // CellBroadcastsConfigDisabled: Whether configuring cell broadcast is
  1868. // disabled.
  1869. CellBroadcastsConfigDisabled bool `json:"cellBroadcastsConfigDisabled,omitempty"`
  1870. // ChoosePrivateKeyRules: Rules for automatically choosing a private key
  1871. // and certificate to authenticate the device to a server. The rules are
  1872. // ordered by increasing precedence, so if an outgoing request matches
  1873. // more than one rule, the last rule defines which private key to use.
  1874. ChoosePrivateKeyRules []*ChoosePrivateKeyRule `json:"choosePrivateKeyRules,omitempty"`
  1875. // ComplianceRules: Rules declaring which mitigating actions to take
  1876. // when a device is not compliant with its policy. When the conditions
  1877. // for multiple rules are satisfied, all of the mitigating actions for
  1878. // the rules are taken. There is a maximum limit of 100 rules.
  1879. ComplianceRules []*ComplianceRule `json:"complianceRules,omitempty"`
  1880. // CreateWindowsDisabled: Whether creating windows besides app windows
  1881. // is disabled.
  1882. CreateWindowsDisabled bool `json:"createWindowsDisabled,omitempty"`
  1883. // CredentialsConfigDisabled: Whether configuring user credentials is
  1884. // disabled.
  1885. CredentialsConfigDisabled bool `json:"credentialsConfigDisabled,omitempty"`
  1886. // DataRoamingDisabled: Whether roaming data services are disabled.
  1887. DataRoamingDisabled bool `json:"dataRoamingDisabled,omitempty"`
  1888. // DebuggingFeaturesAllowed: Whether the user is allowed to enable
  1889. // debugging features.
  1890. DebuggingFeaturesAllowed bool `json:"debuggingFeaturesAllowed,omitempty"`
  1891. // DefaultPermissionPolicy: The default permission policy for runtime
  1892. // permission requests.
  1893. //
  1894. // Possible values:
  1895. // "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no
  1896. // policy is specified for a permission at any level, then the PROMPT
  1897. // behavior is used by default.
  1898. // "PROMPT" - Prompt the user to grant a permission.
  1899. // "GRANT" - Automatically grant a permission.
  1900. // "DENY" - Automatically deny a permission.
  1901. DefaultPermissionPolicy string `json:"defaultPermissionPolicy,omitempty"`
  1902. // DeviceOwnerLockScreenInfo: The device owner information to be shown
  1903. // on the lock screen.
  1904. DeviceOwnerLockScreenInfo *UserFacingMessage `json:"deviceOwnerLockScreenInfo,omitempty"`
  1905. // EncryptionPolicy: Whether encryption is enabled
  1906. //
  1907. // Possible values:
  1908. // "ENCRYPTION_POLICY_UNSPECIFIED" - This value is ignored, i.e. no
  1909. // encryption required
  1910. // "ENABLED_WITHOUT_PASSWORD" - Encryption required but no password
  1911. // required to boot
  1912. // "ENABLED_WITH_PASSWORD" - Encryption required with password
  1913. // required to boot
  1914. EncryptionPolicy string `json:"encryptionPolicy,omitempty"`
  1915. // EnsureVerifyAppsEnabled: Whether app verification is force-enabled.
  1916. EnsureVerifyAppsEnabled bool `json:"ensureVerifyAppsEnabled,omitempty"`
  1917. // FactoryResetDisabled: Whether factory resetting from settings is
  1918. // disabled.
  1919. FactoryResetDisabled bool `json:"factoryResetDisabled,omitempty"`
  1920. // FrpAdminEmails: Email addresses of device administrators for factory
  1921. // reset protection. When the device is factory reset, it will require
  1922. // one of these admins to log in with the Google account email and
  1923. // password to unlock the device. If no admins are specified, the device
  1924. // won't provide factory reset protection.
  1925. FrpAdminEmails []string `json:"frpAdminEmails,omitempty"`
  1926. // FunDisabled: Whether the user is allowed to have fun. Controls
  1927. // whether the Easter egg game in Settings is disabled.
  1928. FunDisabled bool `json:"funDisabled,omitempty"`
  1929. // InstallAppsDisabled: Whether user installation of apps is disabled.
  1930. InstallAppsDisabled bool `json:"installAppsDisabled,omitempty"`
  1931. // InstallUnknownSourcesAllowed: Whether the user is allowed to enable
  1932. // the "Unknown Sources" setting, which allows installation of apps from
  1933. // unknown sources.
  1934. InstallUnknownSourcesAllowed bool `json:"installUnknownSourcesAllowed,omitempty"`
  1935. // KeyguardDisabled: Whether the keyguard is disabled.
  1936. KeyguardDisabled bool `json:"keyguardDisabled,omitempty"`
  1937. // KeyguardDisabledFeatures: Disabled keyguard customizations, such as
  1938. // widgets.
  1939. //
  1940. // Possible values:
  1941. // "KEYGUARD_DISABLED_FEATURE_UNSPECIFIED" - This value is ignored.
  1942. // "CAMERA" - Disable the camera on secure keyguard screens (e.g.
  1943. // PIN).
  1944. // "NOTIFICATIONS" - Disable showing all notifications on secure
  1945. // keyguard screens.
  1946. // "UNREDACTED_NOTIFICATIONS" - Disable unredacted notifications on
  1947. // secure keyguard screens.
  1948. // "TRUST_AGENTS" - Ignore trust agent state on secure keyguard
  1949. // screens.
  1950. // "DISABLE_FINGERPRINT" - Disable fingerprint sensor on keyguard
  1951. // secure screens.
  1952. // "DISABLE_REMOTE_INPUT" - Disable text entry into notifications on
  1953. // secure keyguard screens.
  1954. // "ALL_FEATURES" - Disable all current and future keyguard
  1955. // customizations.
  1956. KeyguardDisabledFeatures []string `json:"keyguardDisabledFeatures,omitempty"`
  1957. // KioskCustomLauncherEnabled: Whether the kiosk custom launcher is
  1958. // enabled. This replaces the home screen with a launcher that locks
  1959. // down the device to the apps installed via the applications setting.
  1960. // The apps appear on a single page in alphabetical order. It is
  1961. // recommended to also use status_bar_disabled to block access to device
  1962. // settings.
  1963. KioskCustomLauncherEnabled bool `json:"kioskCustomLauncherEnabled,omitempty"`
  1964. // LocationMode: The degree of location detection enabled. The user may
  1965. // change the value unless the user is otherwise blocked from accessing
  1966. // device settings.
  1967. //
  1968. // Possible values:
  1969. // "LOCATION_MODE_UNSPECIFIED" - The current device value is not
  1970. // modified.
  1971. // "HIGH_ACCURACY" - All location detection methods are enabled,
  1972. // including GPS, networks, and other sensors.
  1973. // "SENSORS_ONLY" - Only GPS and other sensors are enabled.
  1974. // "BATTERY_SAVING" - Only the network location provider is enabled.
  1975. // "OFF" - Location detection is disabled.
  1976. LocationMode string `json:"locationMode,omitempty"`
  1977. // LongSupportMessage: A message displayed to the user in the device
  1978. // administators settings screen.
  1979. LongSupportMessage *UserFacingMessage `json:"longSupportMessage,omitempty"`
  1980. // MaximumTimeToLock: Maximum time in milliseconds for user activity
  1981. // until the device locks. A value of 0 means there is no restriction.
  1982. MaximumTimeToLock int64 `json:"maximumTimeToLock,omitempty,string"`
  1983. // MobileNetworksConfigDisabled: Whether configuring mobile networks is
  1984. // disabled.
  1985. MobileNetworksConfigDisabled bool `json:"mobileNetworksConfigDisabled,omitempty"`
  1986. // ModifyAccountsDisabled: Whether adding or removing accounts is
  1987. // disabled.
  1988. ModifyAccountsDisabled bool `json:"modifyAccountsDisabled,omitempty"`
  1989. // MountPhysicalMediaDisabled: Whether the user mounting physical
  1990. // external media is disabled.
  1991. MountPhysicalMediaDisabled bool `json:"mountPhysicalMediaDisabled,omitempty"`
  1992. // Name: The name of the policy in the form
  1993. // enterprises/{enterpriseId}/policies/{policyId}.
  1994. Name string `json:"name,omitempty"`
  1995. // NetworkEscapeHatchEnabled: Whether the network escape hatch is
  1996. // enabled. If a network connection can't be made at boot time, the
  1997. // escape hatch prompts the user to temporarily connect to a network in
  1998. // order to refresh the device policy. After applying policy, the
  1999. // temporary network will be forgotten and the device will continue
  2000. // booting. This prevents being unable to connect to a network if there
  2001. // is no suitable network in the last policy and the device boots into
  2002. // an app in lock task mode, or the user is otherwise unable to reach
  2003. // device settings.
  2004. NetworkEscapeHatchEnabled bool `json:"networkEscapeHatchEnabled,omitempty"`
  2005. // NetworkResetDisabled: Whether resetting network settings is disabled.
  2006. NetworkResetDisabled bool `json:"networkResetDisabled,omitempty"`
  2007. // OpenNetworkConfiguration: Network configuration for the device. See
  2008. // configure networks for more information.
  2009. OpenNetworkConfiguration googleapi.RawMessage `json:"openNetworkConfiguration,omitempty"`
  2010. // OutgoingBeamDisabled: Whether using NFC to beam data from apps is
  2011. // disabled.
  2012. OutgoingBeamDisabled bool `json:"outgoingBeamDisabled,omitempty"`
  2013. // OutgoingCallsDisabled: Whether outgoing calls are disabled.
  2014. OutgoingCallsDisabled bool `json:"outgoingCallsDisabled,omitempty"`
  2015. // PasswordRequirements: Password requirements.
  2016. PasswordRequirements *PasswordRequirements `json:"passwordRequirements,omitempty"`
  2017. // PermittedInputMethods: If present, only the input methods provided by
  2018. // packages in this list are permitted. If this field is present, but
  2019. // the list is empty, then only system input methods are permitted.
  2020. PermittedInputMethods *PackageNameList `json:"permittedInputMethods,omitempty"`
  2021. // PersistentPreferredActivities: Default intent handler activities.
  2022. PersistentPreferredActivities []*PersistentPreferredActivity `json:"persistentPreferredActivities,omitempty"`
  2023. // PrivateKeySelectionEnabled: Allows showing UI on a device for a user
  2024. // to choose a private key alias if there are no matching rules in
  2025. // ChoosePrivateKeyRules. For devices below Android P, setting this may
  2026. // leave enterprise keys vulnerable.
  2027. PrivateKeySelectionEnabled bool `json:"privateKeySelectionEnabled,omitempty"`
  2028. // RecommendedGlobalProxy: The network-independent global HTTP proxy.
  2029. // Typically proxies should be configured per-network in
  2030. // open_network_configuration. However for unusual configurations like
  2031. // general internal filtering a global HTTP proxy may be useful. If the
  2032. // proxy is not accessible, network access may break. The global proxy
  2033. // is only a recommendation and some apps may ignore it.
  2034. RecommendedGlobalProxy *ProxyInfo `json:"recommendedGlobalProxy,omitempty"`
  2035. // RemoveUserDisabled: Whether removing other users is disabled.
  2036. RemoveUserDisabled bool `json:"removeUserDisabled,omitempty"`
  2037. // SafeBootDisabled: Whether rebooting the device into safe boot is
  2038. // disabled.
  2039. SafeBootDisabled bool `json:"safeBootDisabled,omitempty"`
  2040. // ScreenCaptureDisabled: Whether screen capture is disabled.
  2041. ScreenCaptureDisabled bool `json:"screenCaptureDisabled,omitempty"`
  2042. // SetUserIconDisabled: Whether changing the user icon is disabled.
  2043. SetUserIconDisabled bool `json:"setUserIconDisabled,omitempty"`
  2044. // SetWallpaperDisabled: Whether changing the wallpaper is disabled.
  2045. SetWallpaperDisabled bool `json:"setWallpaperDisabled,omitempty"`
  2046. // ShareLocationDisabled: Whether location sharing is disabled.
  2047. ShareLocationDisabled bool `json:"shareLocationDisabled,omitempty"`
  2048. // ShortSupportMessage: A message displayed to the user in the settings
  2049. // screen wherever functionality has been disabled by the admin.
  2050. ShortSupportMessage *UserFacingMessage `json:"shortSupportMessage,omitempty"`
  2051. // SkipFirstUseHintsEnabled: Flag to skip hints on the first use.
  2052. // Enterprise admin can enable the system recommendation for apps to
  2053. // skip their user tutorial and other introductory hints on first
  2054. // start-up.
  2055. SkipFirstUseHintsEnabled bool `json:"skipFirstUseHintsEnabled,omitempty"`
  2056. // SmsDisabled: Whether sending and receiving SMS messages is disabled.
  2057. SmsDisabled bool `json:"smsDisabled,omitempty"`
  2058. // StatusBarDisabled: Whether the status bar is disabled. This disables
  2059. // notifications, quick settings, and other screen overlays that allow
  2060. // escape from full-screen mode.
  2061. StatusBarDisabled bool `json:"statusBarDisabled,omitempty"`
  2062. // StatusReportingSettings: Status reporting settings
  2063. StatusReportingSettings *StatusReportingSettings `json:"statusReportingSettings,omitempty"`
  2064. // StayOnPluggedModes: The battery plugged in modes for which the device
  2065. // stays on. When using this setting, it is recommended to clear
  2066. // maximum_time_to_lock so that the device doesn't lock itself while it
  2067. // stays on.
  2068. //
  2069. // Possible values:
  2070. // "BATTERY_PLUGGED_MODE_UNSPECIFIED" - This value is ignored.
  2071. // "AC" - Power source is an AC charger.
  2072. // "USB" - Power source is a USB port.
  2073. // "WIRELESS" - Power source is wireless.
  2074. StayOnPluggedModes []string `json:"stayOnPluggedModes,omitempty"`
  2075. // SystemUpdate: The system update policy, which controls how OS updates
  2076. // are applied. If the update type is WINDOWED, the update window will
  2077. // automatically apply to Play app updates as well.
  2078. SystemUpdate *SystemUpdate `json:"systemUpdate,omitempty"`
  2079. // TetheringConfigDisabled: Whether configuring tethering and portable
  2080. // hotspots is disabled.
  2081. TetheringConfigDisabled bool `json:"tetheringConfigDisabled,omitempty"`
  2082. // UninstallAppsDisabled: Whether user uninstallation of applications is
  2083. // disabled.
  2084. UninstallAppsDisabled bool `json:"uninstallAppsDisabled,omitempty"`
  2085. // UnmuteMicrophoneDisabled: Whether the microphone is muted and
  2086. // adjusting microphone volume is disabled.
  2087. UnmuteMicrophoneDisabled bool `json:"unmuteMicrophoneDisabled,omitempty"`
  2088. // UsbFileTransferDisabled: Whether transferring files over USB is
  2089. // disabled.
  2090. UsbFileTransferDisabled bool `json:"usbFileTransferDisabled,omitempty"`
  2091. // UsbMassStorageEnabled: Whether USB storage is enabled.
  2092. UsbMassStorageEnabled bool `json:"usbMassStorageEnabled,omitempty"`
  2093. // Version: The version of the policy. This is a read-only field. The
  2094. // version is incremented each time the policy is updated.
  2095. Version int64 `json:"version,omitempty,string"`
  2096. // VpnConfigDisabled: Whether configuring VPN is disabled.
  2097. VpnConfigDisabled bool `json:"vpnConfigDisabled,omitempty"`
  2098. // WifiConfigDisabled: Whether configuring Wi-Fi access points is
  2099. // disabled.
  2100. WifiConfigDisabled bool `json:"wifiConfigDisabled,omitempty"`
  2101. // WifiConfigsLockdownEnabled: Whether Wi-Fi networks defined in Open
  2102. // Network Configuration are locked so they can't be edited by the user.
  2103. WifiConfigsLockdownEnabled bool `json:"wifiConfigsLockdownEnabled,omitempty"`
  2104. // ServerResponse contains the HTTP response code and headers from the
  2105. // server.
  2106. googleapi.ServerResponse `json:"-"`
  2107. // ForceSendFields is a list of field names (e.g.
  2108. // "AccountTypesWithManagementDisabled") to unconditionally include in
  2109. // API requests. By default, fields with empty values are omitted from
  2110. // API requests. However, any non-pointer, non-interface field appearing
  2111. // in ForceSendFields will be sent to the server regardless of whether
  2112. // the field is empty or not. This may be used to include empty fields
  2113. // in Patch requests.
  2114. ForceSendFields []string `json:"-"`
  2115. // NullFields is a list of field names (e.g.
  2116. // "AccountTypesWithManagementDisabled") to include in API requests with
  2117. // the JSON null value. By default, fields with empty values are omitted
  2118. // from API requests. However, any field with an empty value appearing
  2119. // in NullFields will be sent to the server as null. It is an error if a
  2120. // field in this list has a non-empty value. This may be used to include
  2121. // null fields in Patch requests.
  2122. NullFields []string `json:"-"`
  2123. }
  2124. func (s *Policy) MarshalJSON() ([]byte, error) {
  2125. type NoMethod Policy
  2126. raw := NoMethod(*s)
  2127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2128. }
  2129. // PowerManagementEvent: A power management event.
  2130. type PowerManagementEvent struct {
  2131. // BatteryLevel: For BATTERY_LEVEL_COLLECTED events, the battery level
  2132. // as a percentage.
  2133. BatteryLevel float64 `json:"batteryLevel,omitempty"`
  2134. // CreateTime: The creation time of the event.
  2135. CreateTime string `json:"createTime,omitempty"`
  2136. // EventType: Event type.
  2137. //
  2138. // Possible values:
  2139. // "POWER_MANAGEMENT_EVENT_TYPE_UNSPECIFIED" - Unspecified. No events
  2140. // have this type.
  2141. // "BATTERY_LEVEL_COLLECTED" - Battery level was measured.
  2142. // "POWER_CONNECTED" - The device started charging.
  2143. // "POWER_DISCONNECTED" - The device stopped charging.
  2144. // "BATTERY_LOW" - The device entered low-power mode.
  2145. // "BATTERY_OKAY" - The device exited low-power mode.
  2146. // "BOOT_COMPLETED" - The device booted.
  2147. // "SHUTDOWN" - The device shut down.
  2148. EventType string `json:"eventType,omitempty"`
  2149. // ForceSendFields is a list of field names (e.g. "BatteryLevel") to
  2150. // unconditionally include in API requests. By default, fields with
  2151. // empty values are omitted from API requests. However, any non-pointer,
  2152. // non-interface field appearing in ForceSendFields will be sent to the
  2153. // server regardless of whether the field is empty or not. This may be
  2154. // used to include empty fields in Patch requests.
  2155. ForceSendFields []string `json:"-"`
  2156. // NullFields is a list of field names (e.g. "BatteryLevel") to include
  2157. // in API requests with the JSON null value. By default, fields with
  2158. // empty values are omitted from API requests. However, any field with
  2159. // an empty value appearing in NullFields will be sent to the server as
  2160. // null. It is an error if a field in this list has a non-empty value.
  2161. // This may be used to include null fields in Patch requests.
  2162. NullFields []string `json:"-"`
  2163. }
  2164. func (s *PowerManagementEvent) MarshalJSON() ([]byte, error) {
  2165. type NoMethod PowerManagementEvent
  2166. raw := NoMethod(*s)
  2167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2168. }
  2169. func (s *PowerManagementEvent) UnmarshalJSON(data []byte) error {
  2170. type NoMethod PowerManagementEvent
  2171. var s1 struct {
  2172. BatteryLevel gensupport.JSONFloat64 `json:"batteryLevel"`
  2173. *NoMethod
  2174. }
  2175. s1.NoMethod = (*NoMethod)(s)
  2176. if err := json.Unmarshal(data, &s1); err != nil {
  2177. return err
  2178. }
  2179. s.BatteryLevel = float64(s1.BatteryLevel)
  2180. return nil
  2181. }
  2182. // ProxyInfo: Configuration info for an HTTP proxy. For a direct proxy,
  2183. // set the host, port, and excluded_hosts fields. For a PAC script
  2184. // proxy, set the pac_uri field.
  2185. type ProxyInfo struct {
  2186. // ExcludedHosts: For a direct proxy, the hosts for which the proxy is
  2187. // bypassed. The host names may contain wildcards such as *.example.com.
  2188. ExcludedHosts []string `json:"excludedHosts,omitempty"`
  2189. // Host: The host of the direct proxy.
  2190. Host string `json:"host,omitempty"`
  2191. // PacUri: The URI of the PAC script used to configure the proxy.
  2192. PacUri string `json:"pacUri,omitempty"`
  2193. // Port: The port of the direct proxy.
  2194. Port int64 `json:"port,omitempty"`
  2195. // ForceSendFields is a list of field names (e.g. "ExcludedHosts") to
  2196. // unconditionally include in API requests. By default, fields with
  2197. // empty values are omitted from API requests. However, any non-pointer,
  2198. // non-interface field appearing in ForceSendFields will be sent to the
  2199. // server regardless of whether the field is empty or not. This may be
  2200. // used to include empty fields in Patch requests.
  2201. ForceSendFields []string `json:"-"`
  2202. // NullFields is a list of field names (e.g. "ExcludedHosts") to include
  2203. // in API requests with the JSON null value. By default, fields with
  2204. // empty values are omitted from API requests. However, any field with
  2205. // an empty value appearing in NullFields will be sent to the server as
  2206. // null. It is an error if a field in this list has a non-empty value.
  2207. // This may be used to include null fields in Patch requests.
  2208. NullFields []string `json:"-"`
  2209. }
  2210. func (s *ProxyInfo) MarshalJSON() ([]byte, error) {
  2211. type NoMethod ProxyInfo
  2212. raw := NoMethod(*s)
  2213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2214. }
  2215. // SignupUrl: An enterprise signup URL.
  2216. type SignupUrl struct {
  2217. // Name: The name of the resource. Use this value in the signupUrl field
  2218. // when calling enterprises.create to complete the enterprise signup
  2219. // flow.
  2220. Name string `json:"name,omitempty"`
  2221. // Url: A URL where an enterprise admin can register their enterprise.
  2222. // The page can't be rendered in an iframe.
  2223. Url string `json:"url,omitempty"`
  2224. // ServerResponse contains the HTTP response code and headers from the
  2225. // server.
  2226. googleapi.ServerResponse `json:"-"`
  2227. // ForceSendFields is a list of field names (e.g. "Name") to
  2228. // unconditionally include in API requests. By default, fields with
  2229. // empty values are omitted from API requests. However, any non-pointer,
  2230. // non-interface field appearing in ForceSendFields will be sent to the
  2231. // server regardless of whether the field is empty or not. This may be
  2232. // used to include empty fields in Patch requests.
  2233. ForceSendFields []string `json:"-"`
  2234. // NullFields is a list of field names (e.g. "Name") to include in API
  2235. // requests with the JSON null value. By default, fields with empty
  2236. // values are omitted from API requests. However, any field with an
  2237. // empty value appearing in NullFields will be sent to the server as
  2238. // null. It is an error if a field in this list has a non-empty value.
  2239. // This may be used to include null fields in Patch requests.
  2240. NullFields []string `json:"-"`
  2241. }
  2242. func (s *SignupUrl) MarshalJSON() ([]byte, error) {
  2243. type NoMethod SignupUrl
  2244. raw := NoMethod(*s)
  2245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2246. }
  2247. // SoftwareInfo: Information about device software.
  2248. type SoftwareInfo struct {
  2249. // AndroidBuildNumber: Android build ID string meant for displaying to
  2250. // the user. For example, shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys.
  2251. AndroidBuildNumber string `json:"androidBuildNumber,omitempty"`
  2252. // AndroidBuildTime: Build time.
  2253. AndroidBuildTime string `json:"androidBuildTime,omitempty"`
  2254. // AndroidDevicePolicyVersionCode: The Android Device Policy app version
  2255. // code.
  2256. AndroidDevicePolicyVersionCode int64 `json:"androidDevicePolicyVersionCode,omitempty"`
  2257. // AndroidDevicePolicyVersionName: The Android Device Policy app version
  2258. // as displayed to the user.
  2259. AndroidDevicePolicyVersionName string `json:"androidDevicePolicyVersionName,omitempty"`
  2260. // AndroidVersion: The user-visible Android version string. For example,
  2261. // 6.0.1.
  2262. AndroidVersion string `json:"androidVersion,omitempty"`
  2263. // BootloaderVersion: The system bootloader version number, e.g. 0.6.7.
  2264. BootloaderVersion string `json:"bootloaderVersion,omitempty"`
  2265. // DeviceBuildSignature: SHA-256 hash of android.content.pm.Signature
  2266. // (https://developer.android.com/reference/android/content/pm/Signature.
  2267. // html) associated with the system package, which can be used to verify
  2268. // that the system build hasn't been modified.
  2269. DeviceBuildSignature string `json:"deviceBuildSignature,omitempty"`
  2270. // DeviceKernelVersion: Kernel version, for example, 2.6.32.9-g103d848.
  2271. DeviceKernelVersion string `json:"deviceKernelVersion,omitempty"`
  2272. // SecurityPatchLevel: Security patch level, e.g. 2016-05-01.
  2273. SecurityPatchLevel string `json:"securityPatchLevel,omitempty"`
  2274. // ForceSendFields is a list of field names (e.g. "AndroidBuildNumber")
  2275. // to unconditionally include in API requests. By default, fields with
  2276. // empty values are omitted from API requests. However, any non-pointer,
  2277. // non-interface field appearing in ForceSendFields will be sent to the
  2278. // server regardless of whether the field is empty or not. This may be
  2279. // used to include empty fields in Patch requests.
  2280. ForceSendFields []string `json:"-"`
  2281. // NullFields is a list of field names (e.g. "AndroidBuildNumber") to
  2282. // include in API requests with the JSON null value. By default, fields
  2283. // with empty values are omitted from API requests. However, any field
  2284. // with an empty value appearing in NullFields will be sent to the
  2285. // server as null. It is an error if a field in this list has a
  2286. // non-empty value. This may be used to include null fields in Patch
  2287. // requests.
  2288. NullFields []string `json:"-"`
  2289. }
  2290. func (s *SoftwareInfo) MarshalJSON() ([]byte, error) {
  2291. type NoMethod SoftwareInfo
  2292. raw := NoMethod(*s)
  2293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2294. }
  2295. // Status: The Status type defines a logical error model that is
  2296. // suitable for different programming environments, including REST APIs
  2297. // and RPC APIs. It is used by gRPC (https://github.com/grpc). The error
  2298. // model is designed to be:
  2299. // Simple to use and understand for most users
  2300. // Flexible enough to meet unexpected needsOverviewThe Status message
  2301. // contains three pieces of data: error code, error message, and error
  2302. // details. The error code should be an enum value of google.rpc.Code,
  2303. // but it may accept additional error codes if needed. The error message
  2304. // should be a developer-facing English message that helps developers
  2305. // understand and resolve the error. If a localized user-facing error
  2306. // message is needed, put the localized message in the error details or
  2307. // localize it in the client. The optional error details may contain
  2308. // arbitrary information about the error. There is a predefined set of
  2309. // error detail types in the package google.rpc that can be used for
  2310. // common error conditions.Language mappingThe Status message is the
  2311. // logical representation of the error model, but it is not necessarily
  2312. // the actual wire format. When the Status message is exposed in
  2313. // different client libraries and different wire protocols, it can be
  2314. // mapped differently. For example, it will likely be mapped to some
  2315. // exceptions in Java, but more likely mapped to some error codes in
  2316. // C.Other usesThe error model and the Status message can be used in a
  2317. // variety of environments, either with or without APIs, to provide a
  2318. // consistent developer experience across different environments.Example
  2319. // uses of this error model include:
  2320. // Partial errors. If a service needs to return partial errors to the
  2321. // client, it may embed the Status in the normal response to indicate
  2322. // the partial errors.
  2323. // Workflow errors. A typical workflow has multiple steps. Each step may
  2324. // have a Status message for error reporting.
  2325. // Batch operations. If a client uses batch request and batch response,
  2326. // the Status message should be used directly inside batch response, one
  2327. // for each error sub-response.
  2328. // Asynchronous operations. If an API call embeds asynchronous operation
  2329. // results in its response, the status of those operations should be
  2330. // represented directly using the Status message.
  2331. // Logging. If some API errors are stored in logs, the message Status
  2332. // could be used directly after any stripping needed for
  2333. // security/privacy reasons.
  2334. type Status struct {
  2335. // Code: The status code, which should be an enum value of
  2336. // google.rpc.Code.
  2337. Code int64 `json:"code,omitempty"`
  2338. // Details: A list of messages that carry the error details. There is a
  2339. // common set of message types for APIs to use.
  2340. Details []googleapi.RawMessage `json:"details,omitempty"`
  2341. // Message: A developer-facing error message, which should be in
  2342. // English. Any user-facing error message should be localized and sent
  2343. // in the google.rpc.Status.details field, or localized by the client.
  2344. Message string `json:"message,omitempty"`
  2345. // ForceSendFields is a list of field names (e.g. "Code") to
  2346. // unconditionally include in API requests. By default, fields with
  2347. // empty values are omitted from API requests. However, any non-pointer,
  2348. // non-interface field appearing in ForceSendFields will be sent to the
  2349. // server regardless of whether the field is empty or not. This may be
  2350. // used to include empty fields in Patch requests.
  2351. ForceSendFields []string `json:"-"`
  2352. // NullFields is a list of field names (e.g. "Code") to include in API
  2353. // requests with the JSON null value. By default, fields with empty
  2354. // values are omitted from API requests. However, any field with an
  2355. // empty value appearing in NullFields will be sent to the server as
  2356. // null. It is an error if a field in this list has a non-empty value.
  2357. // This may be used to include null fields in Patch requests.
  2358. NullFields []string `json:"-"`
  2359. }
  2360. func (s *Status) MarshalJSON() ([]byte, error) {
  2361. type NoMethod Status
  2362. raw := NoMethod(*s)
  2363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2364. }
  2365. // StatusReportingSettings: Settings controlling the behavior of status
  2366. // reports.
  2367. type StatusReportingSettings struct {
  2368. // ApplicationReportsEnabled: Whether app reports are enabled.
  2369. ApplicationReportsEnabled bool `json:"applicationReportsEnabled,omitempty"`
  2370. // DeviceSettingsEnabled: Whether device settings reporting is enabled.
  2371. DeviceSettingsEnabled bool `json:"deviceSettingsEnabled,omitempty"`
  2372. // DisplayInfoEnabled: Whether displays reporting is enabled.
  2373. DisplayInfoEnabled bool `json:"displayInfoEnabled,omitempty"`
  2374. // HardwareStatusEnabled: Whether hardware status reporting is enabled.
  2375. HardwareStatusEnabled bool `json:"hardwareStatusEnabled,omitempty"`
  2376. // MemoryInfoEnabled: Whether memory info reporting is enabled.
  2377. MemoryInfoEnabled bool `json:"memoryInfoEnabled,omitempty"`
  2378. // NetworkInfoEnabled: Whether network info reporting is enabled.
  2379. NetworkInfoEnabled bool `json:"networkInfoEnabled,omitempty"`
  2380. // PowerManagementEventsEnabled: Whether power management event
  2381. // reporting is enabled.
  2382. PowerManagementEventsEnabled bool `json:"powerManagementEventsEnabled,omitempty"`
  2383. // SoftwareInfoEnabled: Whether software info reporting is enabled.
  2384. SoftwareInfoEnabled bool `json:"softwareInfoEnabled,omitempty"`
  2385. // ForceSendFields is a list of field names (e.g.
  2386. // "ApplicationReportsEnabled") to unconditionally include in API
  2387. // requests. By default, fields with empty values are omitted from API
  2388. // requests. However, any non-pointer, non-interface field appearing in
  2389. // ForceSendFields will be sent to the server regardless of whether the
  2390. // field is empty or not. This may be used to include empty fields in
  2391. // Patch requests.
  2392. ForceSendFields []string `json:"-"`
  2393. // NullFields is a list of field names (e.g.
  2394. // "ApplicationReportsEnabled") to include in API requests with the JSON
  2395. // null value. By default, fields with empty values are omitted from API
  2396. // requests. However, any field with an empty value appearing in
  2397. // NullFields will be sent to the server as null. It is an error if a
  2398. // field in this list has a non-empty value. This may be used to include
  2399. // null fields in Patch requests.
  2400. NullFields []string `json:"-"`
  2401. }
  2402. func (s *StatusReportingSettings) MarshalJSON() ([]byte, error) {
  2403. type NoMethod StatusReportingSettings
  2404. raw := NoMethod(*s)
  2405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2406. }
  2407. // SystemUpdate: Configuration for managing system updates
  2408. type SystemUpdate struct {
  2409. // EndMinutes: If the type is WINDOWED, the end of the maintenance
  2410. // window, measured as the number of minutes after midnight in device's
  2411. // local time. This value must be between 0 and 1439, inclusive. If this
  2412. // value is less than start_minutes, then the maintenance window spans
  2413. // midnight. If the maintenance window specified is smaller than 30
  2414. // minutes, the actual window is extended to 30 minutes beyond the start
  2415. // time.
  2416. EndMinutes int64 `json:"endMinutes,omitempty"`
  2417. // StartMinutes: If the type is WINDOWED, the start of the maintenance
  2418. // window, measured as the number of minutes after midnight in the
  2419. // device's local time. This value must be between 0 and 1439,
  2420. // inclusive.
  2421. StartMinutes int64 `json:"startMinutes,omitempty"`
  2422. // Type: The type of system update to configure.
  2423. //
  2424. // Possible values:
  2425. // "SYSTEM_UPDATE_TYPE_UNSPECIFIED" - Follow the default update
  2426. // behavior for the device, which typically requires the user to accept
  2427. // system updates.
  2428. // "AUTOMATIC" - Install automatically as soon as an update is
  2429. // available.
  2430. // "WINDOWED" - Install automatically within a daily maintenance
  2431. // window. This also configures Play apps to be updated within the
  2432. // window. This is strongly recommended for kiosk devices because this
  2433. // is the only way apps persistently pinned to the foreground can be
  2434. // updated by Play.
  2435. // "POSTPONE" - Postpone automatic install up to a maximum of 30 days.
  2436. Type string `json:"type,omitempty"`
  2437. // ForceSendFields is a list of field names (e.g. "EndMinutes") to
  2438. // unconditionally include in API requests. By default, fields with
  2439. // empty values are omitted from API requests. However, any non-pointer,
  2440. // non-interface field appearing in ForceSendFields will be sent to the
  2441. // server regardless of whether the field is empty or not. This may be
  2442. // used to include empty fields in Patch requests.
  2443. ForceSendFields []string `json:"-"`
  2444. // NullFields is a list of field names (e.g. "EndMinutes") to include in
  2445. // API requests with the JSON null value. By default, fields with empty
  2446. // values are omitted from API requests. However, any field with an
  2447. // empty value appearing in NullFields will be sent to the server as
  2448. // null. It is an error if a field in this list has a non-empty value.
  2449. // This may be used to include null fields in Patch requests.
  2450. NullFields []string `json:"-"`
  2451. }
  2452. func (s *SystemUpdate) MarshalJSON() ([]byte, error) {
  2453. type NoMethod SystemUpdate
  2454. raw := NoMethod(*s)
  2455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2456. }
  2457. // TermsAndConditions: A terms and conditions page to be accepted during
  2458. // provisioning.
  2459. type TermsAndConditions struct {
  2460. // Content: A well-formatted HTML string. It will be parsed on the
  2461. // client with android.text.Html#fromHtml.
  2462. Content *UserFacingMessage `json:"content,omitempty"`
  2463. // Header: A short header which appears above the HTML content.
  2464. Header *UserFacingMessage `json:"header,omitempty"`
  2465. // ForceSendFields is a list of field names (e.g. "Content") to
  2466. // unconditionally include in API requests. By default, fields with
  2467. // empty values are omitted from API requests. However, any non-pointer,
  2468. // non-interface field appearing in ForceSendFields will be sent to the
  2469. // server regardless of whether the field is empty or not. This may be
  2470. // used to include empty fields in Patch requests.
  2471. ForceSendFields []string `json:"-"`
  2472. // NullFields is a list of field names (e.g. "Content") to include in
  2473. // API requests with the JSON null value. By default, fields with empty
  2474. // values are omitted from API requests. However, any field with an
  2475. // empty value appearing in NullFields will be sent to the server as
  2476. // null. It is an error if a field in this list has a non-empty value.
  2477. // This may be used to include null fields in Patch requests.
  2478. NullFields []string `json:"-"`
  2479. }
  2480. func (s *TermsAndConditions) MarshalJSON() ([]byte, error) {
  2481. type NoMethod TermsAndConditions
  2482. raw := NoMethod(*s)
  2483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2484. }
  2485. // UserFacingMessage: Provides a user-facing message with locale info.
  2486. // The maximum message length is 4096 characters.
  2487. type UserFacingMessage struct {
  2488. // DefaultMessage: The default message displayed if no localized message
  2489. // is specified or the user's locale doesn't match with any of the
  2490. // localized messages. A default message must be provided if any
  2491. // localized messages are provided.
  2492. DefaultMessage string `json:"defaultMessage,omitempty"`
  2493. // LocalizedMessages: A map containing <locale, message> pairs, where
  2494. // locale is a well-formed BCP 47 language
  2495. // (https://www.w3.org/International/articles/language-tags/) code, such
  2496. // as en-US, es-ES, or fr.
  2497. LocalizedMessages map[string]string `json:"localizedMessages,omitempty"`
  2498. // ForceSendFields is a list of field names (e.g. "DefaultMessage") to
  2499. // unconditionally include in API requests. By default, fields with
  2500. // empty values are omitted from API requests. However, any non-pointer,
  2501. // non-interface field appearing in ForceSendFields will be sent to the
  2502. // server regardless of whether the field is empty or not. This may be
  2503. // used to include empty fields in Patch requests.
  2504. ForceSendFields []string `json:"-"`
  2505. // NullFields is a list of field names (e.g. "DefaultMessage") to
  2506. // include in API requests with the JSON null value. By default, fields
  2507. // with empty values are omitted from API requests. However, any field
  2508. // with an empty value appearing in NullFields will be sent to the
  2509. // server as null. It is an error if a field in this list has a
  2510. // non-empty value. This may be used to include null fields in Patch
  2511. // requests.
  2512. NullFields []string `json:"-"`
  2513. }
  2514. func (s *UserFacingMessage) MarshalJSON() ([]byte, error) {
  2515. type NoMethod UserFacingMessage
  2516. raw := NoMethod(*s)
  2517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2518. }
  2519. // WebToken: A web token used to access the managed Google Play iframe.
  2520. type WebToken struct {
  2521. // Name: The name of the web token, which is generated by the server
  2522. // during creation in the form
  2523. // enterprises/{enterpriseId}/webTokens/{webTokenId}.
  2524. Name string `json:"name,omitempty"`
  2525. // ParentFrameUrl: The URL of the parent frame hosting the iframe with
  2526. // the embedded UI. To prevent XSS, the iframe may not be hosted at
  2527. // other URLs. The URL must use the https scheme.
  2528. ParentFrameUrl string `json:"parentFrameUrl,omitempty"`
  2529. // Permissions: Permissions available to an admin in the embedded UI. An
  2530. // admin must have all of these permissions in order to view the UI.
  2531. //
  2532. // Possible values:
  2533. // "WEB_TOKEN_PERMISSION_UNSPECIFIED" - This value is ignored.
  2534. // "APPROVE_APPS" - The permission to approve apps for the enterprise.
  2535. Permissions []string `json:"permissions,omitempty"`
  2536. // Value: The token value which is used in the hosting page to generate
  2537. // the iframe with the embedded UI. This is a read-only field generated
  2538. // by the server.
  2539. Value string `json:"value,omitempty"`
  2540. // ServerResponse contains the HTTP response code and headers from the
  2541. // server.
  2542. googleapi.ServerResponse `json:"-"`
  2543. // ForceSendFields is a list of field names (e.g. "Name") to
  2544. // unconditionally include in API requests. By default, fields with
  2545. // empty values are omitted from API requests. However, any non-pointer,
  2546. // non-interface field appearing in ForceSendFields will be sent to the
  2547. // server regardless of whether the field is empty or not. This may be
  2548. // used to include empty fields in Patch requests.
  2549. ForceSendFields []string `json:"-"`
  2550. // NullFields is a list of field names (e.g. "Name") to include in API
  2551. // requests with the JSON null value. By default, fields with empty
  2552. // values are omitted from API requests. However, any field with an
  2553. // empty value appearing in NullFields will be sent to the server as
  2554. // null. It is an error if a field in this list has a non-empty value.
  2555. // This may be used to include null fields in Patch requests.
  2556. NullFields []string `json:"-"`
  2557. }
  2558. func (s *WebToken) MarshalJSON() ([]byte, error) {
  2559. type NoMethod WebToken
  2560. raw := NoMethod(*s)
  2561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2562. }
  2563. // method id "androidmanagement.enterprises.create":
  2564. type EnterprisesCreateCall struct {
  2565. s *Service
  2566. enterprise *Enterprise
  2567. urlParams_ gensupport.URLParams
  2568. ctx_ context.Context
  2569. header_ http.Header
  2570. }
  2571. // Create: Creates an enterprise. This is the last step in the
  2572. // enterprise signup flow.
  2573. func (r *EnterprisesService) Create(enterprise *Enterprise) *EnterprisesCreateCall {
  2574. c := &EnterprisesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2575. c.enterprise = enterprise
  2576. return c
  2577. }
  2578. // EnterpriseToken sets the optional parameter "enterpriseToken": The
  2579. // enterprise token appended to the callback URL.
  2580. func (c *EnterprisesCreateCall) EnterpriseToken(enterpriseToken string) *EnterprisesCreateCall {
  2581. c.urlParams_.Set("enterpriseToken", enterpriseToken)
  2582. return c
  2583. }
  2584. // ProjectId sets the optional parameter "projectId": The ID of the
  2585. // Google Cloud Platform project which will own the enterprise.
  2586. func (c *EnterprisesCreateCall) ProjectId(projectId string) *EnterprisesCreateCall {
  2587. c.urlParams_.Set("projectId", projectId)
  2588. return c
  2589. }
  2590. // SignupUrlName sets the optional parameter "signupUrlName": The name
  2591. // of the SignupUrl used to sign up for the enterprise.
  2592. func (c *EnterprisesCreateCall) SignupUrlName(signupUrlName string) *EnterprisesCreateCall {
  2593. c.urlParams_.Set("signupUrlName", signupUrlName)
  2594. return c
  2595. }
  2596. // Fields allows partial responses to be retrieved. See
  2597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2598. // for more information.
  2599. func (c *EnterprisesCreateCall) Fields(s ...googleapi.Field) *EnterprisesCreateCall {
  2600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2601. return c
  2602. }
  2603. // Context sets the context to be used in this call's Do method. Any
  2604. // pending HTTP request will be aborted if the provided context is
  2605. // canceled.
  2606. func (c *EnterprisesCreateCall) Context(ctx context.Context) *EnterprisesCreateCall {
  2607. c.ctx_ = ctx
  2608. return c
  2609. }
  2610. // Header returns an http.Header that can be modified by the caller to
  2611. // add HTTP headers to the request.
  2612. func (c *EnterprisesCreateCall) Header() http.Header {
  2613. if c.header_ == nil {
  2614. c.header_ = make(http.Header)
  2615. }
  2616. return c.header_
  2617. }
  2618. func (c *EnterprisesCreateCall) doRequest(alt string) (*http.Response, error) {
  2619. reqHeaders := make(http.Header)
  2620. for k, v := range c.header_ {
  2621. reqHeaders[k] = v
  2622. }
  2623. reqHeaders.Set("User-Agent", c.s.userAgent())
  2624. var body io.Reader = nil
  2625. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
  2626. if err != nil {
  2627. return nil, err
  2628. }
  2629. reqHeaders.Set("Content-Type", "application/json")
  2630. c.urlParams_.Set("alt", alt)
  2631. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/enterprises")
  2632. urls += "?" + c.urlParams_.Encode()
  2633. req, _ := http.NewRequest("POST", urls, body)
  2634. req.Header = reqHeaders
  2635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2636. }
  2637. // Do executes the "androidmanagement.enterprises.create" call.
  2638. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  2639. // status code is an error. Response headers are in either
  2640. // *Enterprise.ServerResponse.Header or (if a response was returned at
  2641. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2642. // to check whether the returned error was because
  2643. // http.StatusNotModified was returned.
  2644. func (c *EnterprisesCreateCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  2645. gensupport.SetOptions(c.urlParams_, opts...)
  2646. res, err := c.doRequest("json")
  2647. if res != nil && res.StatusCode == http.StatusNotModified {
  2648. if res.Body != nil {
  2649. res.Body.Close()
  2650. }
  2651. return nil, &googleapi.Error{
  2652. Code: res.StatusCode,
  2653. Header: res.Header,
  2654. }
  2655. }
  2656. if err != nil {
  2657. return nil, err
  2658. }
  2659. defer googleapi.CloseBody(res)
  2660. if err := googleapi.CheckResponse(res); err != nil {
  2661. return nil, err
  2662. }
  2663. ret := &Enterprise{
  2664. ServerResponse: googleapi.ServerResponse{
  2665. Header: res.Header,
  2666. HTTPStatusCode: res.StatusCode,
  2667. },
  2668. }
  2669. target := &ret
  2670. if err := gensupport.DecodeResponse(target, res); err != nil {
  2671. return nil, err
  2672. }
  2673. return ret, nil
  2674. // {
  2675. // "description": "Creates an enterprise. This is the last step in the enterprise signup flow.",
  2676. // "flatPath": "v1/enterprises",
  2677. // "httpMethod": "POST",
  2678. // "id": "androidmanagement.enterprises.create",
  2679. // "parameterOrder": [],
  2680. // "parameters": {
  2681. // "enterpriseToken": {
  2682. // "description": "The enterprise token appended to the callback URL.",
  2683. // "location": "query",
  2684. // "type": "string"
  2685. // },
  2686. // "projectId": {
  2687. // "description": "The ID of the Google Cloud Platform project which will own the enterprise.",
  2688. // "location": "query",
  2689. // "type": "string"
  2690. // },
  2691. // "signupUrlName": {
  2692. // "description": "The name of the SignupUrl used to sign up for the enterprise.",
  2693. // "location": "query",
  2694. // "type": "string"
  2695. // }
  2696. // },
  2697. // "path": "v1/enterprises",
  2698. // "request": {
  2699. // "$ref": "Enterprise"
  2700. // },
  2701. // "response": {
  2702. // "$ref": "Enterprise"
  2703. // },
  2704. // "scopes": [
  2705. // "https://www.googleapis.com/auth/androidmanagement"
  2706. // ]
  2707. // }
  2708. }
  2709. // method id "androidmanagement.enterprises.get":
  2710. type EnterprisesGetCall struct {
  2711. s *Service
  2712. name string
  2713. urlParams_ gensupport.URLParams
  2714. ifNoneMatch_ string
  2715. ctx_ context.Context
  2716. header_ http.Header
  2717. }
  2718. // Get: Gets an enterprise.
  2719. func (r *EnterprisesService) Get(name string) *EnterprisesGetCall {
  2720. c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2721. c.name = name
  2722. return c
  2723. }
  2724. // Fields allows partial responses to be retrieved. See
  2725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2726. // for more information.
  2727. func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall {
  2728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2729. return c
  2730. }
  2731. // IfNoneMatch sets the optional parameter which makes the operation
  2732. // fail if the object's ETag matches the given value. This is useful for
  2733. // getting updates only after the object has changed since the last
  2734. // request. Use googleapi.IsNotModified to check whether the response
  2735. // error from Do is the result of In-None-Match.
  2736. func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall {
  2737. c.ifNoneMatch_ = entityTag
  2738. return c
  2739. }
  2740. // Context sets the context to be used in this call's Do method. Any
  2741. // pending HTTP request will be aborted if the provided context is
  2742. // canceled.
  2743. func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall {
  2744. c.ctx_ = ctx
  2745. return c
  2746. }
  2747. // Header returns an http.Header that can be modified by the caller to
  2748. // add HTTP headers to the request.
  2749. func (c *EnterprisesGetCall) Header() http.Header {
  2750. if c.header_ == nil {
  2751. c.header_ = make(http.Header)
  2752. }
  2753. return c.header_
  2754. }
  2755. func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) {
  2756. reqHeaders := make(http.Header)
  2757. for k, v := range c.header_ {
  2758. reqHeaders[k] = v
  2759. }
  2760. reqHeaders.Set("User-Agent", c.s.userAgent())
  2761. if c.ifNoneMatch_ != "" {
  2762. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2763. }
  2764. var body io.Reader = nil
  2765. c.urlParams_.Set("alt", alt)
  2766. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2767. urls += "?" + c.urlParams_.Encode()
  2768. req, _ := http.NewRequest("GET", urls, body)
  2769. req.Header = reqHeaders
  2770. googleapi.Expand(req.URL, map[string]string{
  2771. "name": c.name,
  2772. })
  2773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2774. }
  2775. // Do executes the "androidmanagement.enterprises.get" call.
  2776. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  2777. // status code is an error. Response headers are in either
  2778. // *Enterprise.ServerResponse.Header or (if a response was returned at
  2779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2780. // to check whether the returned error was because
  2781. // http.StatusNotModified was returned.
  2782. func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  2783. gensupport.SetOptions(c.urlParams_, opts...)
  2784. res, err := c.doRequest("json")
  2785. if res != nil && res.StatusCode == http.StatusNotModified {
  2786. if res.Body != nil {
  2787. res.Body.Close()
  2788. }
  2789. return nil, &googleapi.Error{
  2790. Code: res.StatusCode,
  2791. Header: res.Header,
  2792. }
  2793. }
  2794. if err != nil {
  2795. return nil, err
  2796. }
  2797. defer googleapi.CloseBody(res)
  2798. if err := googleapi.CheckResponse(res); err != nil {
  2799. return nil, err
  2800. }
  2801. ret := &Enterprise{
  2802. ServerResponse: googleapi.ServerResponse{
  2803. Header: res.Header,
  2804. HTTPStatusCode: res.StatusCode,
  2805. },
  2806. }
  2807. target := &ret
  2808. if err := gensupport.DecodeResponse(target, res); err != nil {
  2809. return nil, err
  2810. }
  2811. return ret, nil
  2812. // {
  2813. // "description": "Gets an enterprise.",
  2814. // "flatPath": "v1/enterprises/{enterprisesId}",
  2815. // "httpMethod": "GET",
  2816. // "id": "androidmanagement.enterprises.get",
  2817. // "parameterOrder": [
  2818. // "name"
  2819. // ],
  2820. // "parameters": {
  2821. // "name": {
  2822. // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.",
  2823. // "location": "path",
  2824. // "pattern": "^enterprises/[^/]+$",
  2825. // "required": true,
  2826. // "type": "string"
  2827. // }
  2828. // },
  2829. // "path": "v1/{+name}",
  2830. // "response": {
  2831. // "$ref": "Enterprise"
  2832. // },
  2833. // "scopes": [
  2834. // "https://www.googleapis.com/auth/androidmanagement"
  2835. // ]
  2836. // }
  2837. }
  2838. // method id "androidmanagement.enterprises.patch":
  2839. type EnterprisesPatchCall struct {
  2840. s *Service
  2841. name string
  2842. enterprise *Enterprise
  2843. urlParams_ gensupport.URLParams
  2844. ctx_ context.Context
  2845. header_ http.Header
  2846. }
  2847. // Patch: Updates an enterprise.
  2848. func (r *EnterprisesService) Patch(name string, enterprise *Enterprise) *EnterprisesPatchCall {
  2849. c := &EnterprisesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2850. c.name = name
  2851. c.enterprise = enterprise
  2852. return c
  2853. }
  2854. // UpdateMask sets the optional parameter "updateMask": The field mask
  2855. // indicating the fields to update. If not set, all modifiable fields
  2856. // will be modified.
  2857. func (c *EnterprisesPatchCall) UpdateMask(updateMask string) *EnterprisesPatchCall {
  2858. c.urlParams_.Set("updateMask", updateMask)
  2859. return c
  2860. }
  2861. // Fields allows partial responses to be retrieved. See
  2862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2863. // for more information.
  2864. func (c *EnterprisesPatchCall) Fields(s ...googleapi.Field) *EnterprisesPatchCall {
  2865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2866. return c
  2867. }
  2868. // Context sets the context to be used in this call's Do method. Any
  2869. // pending HTTP request will be aborted if the provided context is
  2870. // canceled.
  2871. func (c *EnterprisesPatchCall) Context(ctx context.Context) *EnterprisesPatchCall {
  2872. c.ctx_ = ctx
  2873. return c
  2874. }
  2875. // Header returns an http.Header that can be modified by the caller to
  2876. // add HTTP headers to the request.
  2877. func (c *EnterprisesPatchCall) Header() http.Header {
  2878. if c.header_ == nil {
  2879. c.header_ = make(http.Header)
  2880. }
  2881. return c.header_
  2882. }
  2883. func (c *EnterprisesPatchCall) doRequest(alt string) (*http.Response, error) {
  2884. reqHeaders := make(http.Header)
  2885. for k, v := range c.header_ {
  2886. reqHeaders[k] = v
  2887. }
  2888. reqHeaders.Set("User-Agent", c.s.userAgent())
  2889. var body io.Reader = nil
  2890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
  2891. if err != nil {
  2892. return nil, err
  2893. }
  2894. reqHeaders.Set("Content-Type", "application/json")
  2895. c.urlParams_.Set("alt", alt)
  2896. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2897. urls += "?" + c.urlParams_.Encode()
  2898. req, _ := http.NewRequest("PATCH", urls, body)
  2899. req.Header = reqHeaders
  2900. googleapi.Expand(req.URL, map[string]string{
  2901. "name": c.name,
  2902. })
  2903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2904. }
  2905. // Do executes the "androidmanagement.enterprises.patch" call.
  2906. // Exactly one of *Enterprise or error will be non-nil. Any non-2xx
  2907. // status code is an error. Response headers are in either
  2908. // *Enterprise.ServerResponse.Header or (if a response was returned at
  2909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2910. // to check whether the returned error was because
  2911. // http.StatusNotModified was returned.
  2912. func (c *EnterprisesPatchCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
  2913. gensupport.SetOptions(c.urlParams_, opts...)
  2914. res, err := c.doRequest("json")
  2915. if res != nil && res.StatusCode == http.StatusNotModified {
  2916. if res.Body != nil {
  2917. res.Body.Close()
  2918. }
  2919. return nil, &googleapi.Error{
  2920. Code: res.StatusCode,
  2921. Header: res.Header,
  2922. }
  2923. }
  2924. if err != nil {
  2925. return nil, err
  2926. }
  2927. defer googleapi.CloseBody(res)
  2928. if err := googleapi.CheckResponse(res); err != nil {
  2929. return nil, err
  2930. }
  2931. ret := &Enterprise{
  2932. ServerResponse: googleapi.ServerResponse{
  2933. Header: res.Header,
  2934. HTTPStatusCode: res.StatusCode,
  2935. },
  2936. }
  2937. target := &ret
  2938. if err := gensupport.DecodeResponse(target, res); err != nil {
  2939. return nil, err
  2940. }
  2941. return ret, nil
  2942. // {
  2943. // "description": "Updates an enterprise.",
  2944. // "flatPath": "v1/enterprises/{enterprisesId}",
  2945. // "httpMethod": "PATCH",
  2946. // "id": "androidmanagement.enterprises.patch",
  2947. // "parameterOrder": [
  2948. // "name"
  2949. // ],
  2950. // "parameters": {
  2951. // "name": {
  2952. // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.",
  2953. // "location": "path",
  2954. // "pattern": "^enterprises/[^/]+$",
  2955. // "required": true,
  2956. // "type": "string"
  2957. // },
  2958. // "updateMask": {
  2959. // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.",
  2960. // "format": "google-fieldmask",
  2961. // "location": "query",
  2962. // "type": "string"
  2963. // }
  2964. // },
  2965. // "path": "v1/{+name}",
  2966. // "request": {
  2967. // "$ref": "Enterprise"
  2968. // },
  2969. // "response": {
  2970. // "$ref": "Enterprise"
  2971. // },
  2972. // "scopes": [
  2973. // "https://www.googleapis.com/auth/androidmanagement"
  2974. // ]
  2975. // }
  2976. }
  2977. // method id "androidmanagement.enterprises.applications.get":
  2978. type EnterprisesApplicationsGetCall struct {
  2979. s *Service
  2980. name string
  2981. urlParams_ gensupport.URLParams
  2982. ifNoneMatch_ string
  2983. ctx_ context.Context
  2984. header_ http.Header
  2985. }
  2986. // Get: Gets info about an application.
  2987. func (r *EnterprisesApplicationsService) Get(name string) *EnterprisesApplicationsGetCall {
  2988. c := &EnterprisesApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2989. c.name = name
  2990. return c
  2991. }
  2992. // LanguageCode sets the optional parameter "languageCode": The
  2993. // preferred language for localized application info, as a BCP47 tag
  2994. // (e.g. "en-US", "de"). If not specified the default language of the
  2995. // application will be used.
  2996. func (c *EnterprisesApplicationsGetCall) LanguageCode(languageCode string) *EnterprisesApplicationsGetCall {
  2997. c.urlParams_.Set("languageCode", languageCode)
  2998. return c
  2999. }
  3000. // Fields allows partial responses to be retrieved. See
  3001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3002. // for more information.
  3003. func (c *EnterprisesApplicationsGetCall) Fields(s ...googleapi.Field) *EnterprisesApplicationsGetCall {
  3004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3005. return c
  3006. }
  3007. // IfNoneMatch sets the optional parameter which makes the operation
  3008. // fail if the object's ETag matches the given value. This is useful for
  3009. // getting updates only after the object has changed since the last
  3010. // request. Use googleapi.IsNotModified to check whether the response
  3011. // error from Do is the result of In-None-Match.
  3012. func (c *EnterprisesApplicationsGetCall) IfNoneMatch(entityTag string) *EnterprisesApplicationsGetCall {
  3013. c.ifNoneMatch_ = entityTag
  3014. return c
  3015. }
  3016. // Context sets the context to be used in this call's Do method. Any
  3017. // pending HTTP request will be aborted if the provided context is
  3018. // canceled.
  3019. func (c *EnterprisesApplicationsGetCall) Context(ctx context.Context) *EnterprisesApplicationsGetCall {
  3020. c.ctx_ = ctx
  3021. return c
  3022. }
  3023. // Header returns an http.Header that can be modified by the caller to
  3024. // add HTTP headers to the request.
  3025. func (c *EnterprisesApplicationsGetCall) Header() http.Header {
  3026. if c.header_ == nil {
  3027. c.header_ = make(http.Header)
  3028. }
  3029. return c.header_
  3030. }
  3031. func (c *EnterprisesApplicationsGetCall) doRequest(alt string) (*http.Response, error) {
  3032. reqHeaders := make(http.Header)
  3033. for k, v := range c.header_ {
  3034. reqHeaders[k] = v
  3035. }
  3036. reqHeaders.Set("User-Agent", c.s.userAgent())
  3037. if c.ifNoneMatch_ != "" {
  3038. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3039. }
  3040. var body io.Reader = nil
  3041. c.urlParams_.Set("alt", alt)
  3042. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3043. urls += "?" + c.urlParams_.Encode()
  3044. req, _ := http.NewRequest("GET", urls, body)
  3045. req.Header = reqHeaders
  3046. googleapi.Expand(req.URL, map[string]string{
  3047. "name": c.name,
  3048. })
  3049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3050. }
  3051. // Do executes the "androidmanagement.enterprises.applications.get" call.
  3052. // Exactly one of *Application or error will be non-nil. Any non-2xx
  3053. // status code is an error. Response headers are in either
  3054. // *Application.ServerResponse.Header or (if a response was returned at
  3055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3056. // to check whether the returned error was because
  3057. // http.StatusNotModified was returned.
  3058. func (c *EnterprisesApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) {
  3059. gensupport.SetOptions(c.urlParams_, opts...)
  3060. res, err := c.doRequest("json")
  3061. if res != nil && res.StatusCode == http.StatusNotModified {
  3062. if res.Body != nil {
  3063. res.Body.Close()
  3064. }
  3065. return nil, &googleapi.Error{
  3066. Code: res.StatusCode,
  3067. Header: res.Header,
  3068. }
  3069. }
  3070. if err != nil {
  3071. return nil, err
  3072. }
  3073. defer googleapi.CloseBody(res)
  3074. if err := googleapi.CheckResponse(res); err != nil {
  3075. return nil, err
  3076. }
  3077. ret := &Application{
  3078. ServerResponse: googleapi.ServerResponse{
  3079. Header: res.Header,
  3080. HTTPStatusCode: res.StatusCode,
  3081. },
  3082. }
  3083. target := &ret
  3084. if err := gensupport.DecodeResponse(target, res); err != nil {
  3085. return nil, err
  3086. }
  3087. return ret, nil
  3088. // {
  3089. // "description": "Gets info about an application.",
  3090. // "flatPath": "v1/enterprises/{enterprisesId}/applications/{applicationsId}",
  3091. // "httpMethod": "GET",
  3092. // "id": "androidmanagement.enterprises.applications.get",
  3093. // "parameterOrder": [
  3094. // "name"
  3095. // ],
  3096. // "parameters": {
  3097. // "languageCode": {
  3098. // "description": "The preferred language for localized application info, as a BCP47 tag (e.g. \"en-US\", \"de\"). If not specified the default language of the application will be used.",
  3099. // "location": "query",
  3100. // "type": "string"
  3101. // },
  3102. // "name": {
  3103. // "description": "The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}.",
  3104. // "location": "path",
  3105. // "pattern": "^enterprises/[^/]+/applications/[^/]+$",
  3106. // "required": true,
  3107. // "type": "string"
  3108. // }
  3109. // },
  3110. // "path": "v1/{+name}",
  3111. // "response": {
  3112. // "$ref": "Application"
  3113. // },
  3114. // "scopes": [
  3115. // "https://www.googleapis.com/auth/androidmanagement"
  3116. // ]
  3117. // }
  3118. }
  3119. // method id "androidmanagement.enterprises.devices.delete":
  3120. type EnterprisesDevicesDeleteCall struct {
  3121. s *Service
  3122. name string
  3123. urlParams_ gensupport.URLParams
  3124. ctx_ context.Context
  3125. header_ http.Header
  3126. }
  3127. // Delete: Deletes a device. This operation wipes the device.
  3128. func (r *EnterprisesDevicesService) Delete(name string) *EnterprisesDevicesDeleteCall {
  3129. c := &EnterprisesDevicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3130. c.name = name
  3131. return c
  3132. }
  3133. // Fields allows partial responses to be retrieved. See
  3134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3135. // for more information.
  3136. func (c *EnterprisesDevicesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDevicesDeleteCall {
  3137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3138. return c
  3139. }
  3140. // Context sets the context to be used in this call's Do method. Any
  3141. // pending HTTP request will be aborted if the provided context is
  3142. // canceled.
  3143. func (c *EnterprisesDevicesDeleteCall) Context(ctx context.Context) *EnterprisesDevicesDeleteCall {
  3144. c.ctx_ = ctx
  3145. return c
  3146. }
  3147. // Header returns an http.Header that can be modified by the caller to
  3148. // add HTTP headers to the request.
  3149. func (c *EnterprisesDevicesDeleteCall) Header() http.Header {
  3150. if c.header_ == nil {
  3151. c.header_ = make(http.Header)
  3152. }
  3153. return c.header_
  3154. }
  3155. func (c *EnterprisesDevicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  3156. reqHeaders := make(http.Header)
  3157. for k, v := range c.header_ {
  3158. reqHeaders[k] = v
  3159. }
  3160. reqHeaders.Set("User-Agent", c.s.userAgent())
  3161. var body io.Reader = nil
  3162. c.urlParams_.Set("alt", alt)
  3163. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3164. urls += "?" + c.urlParams_.Encode()
  3165. req, _ := http.NewRequest("DELETE", urls, body)
  3166. req.Header = reqHeaders
  3167. googleapi.Expand(req.URL, map[string]string{
  3168. "name": c.name,
  3169. })
  3170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3171. }
  3172. // Do executes the "androidmanagement.enterprises.devices.delete" call.
  3173. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3174. // code is an error. Response headers are in either
  3175. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3176. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3177. // check whether the returned error was because http.StatusNotModified
  3178. // was returned.
  3179. func (c *EnterprisesDevicesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3180. gensupport.SetOptions(c.urlParams_, opts...)
  3181. res, err := c.doRequest("json")
  3182. if res != nil && res.StatusCode == http.StatusNotModified {
  3183. if res.Body != nil {
  3184. res.Body.Close()
  3185. }
  3186. return nil, &googleapi.Error{
  3187. Code: res.StatusCode,
  3188. Header: res.Header,
  3189. }
  3190. }
  3191. if err != nil {
  3192. return nil, err
  3193. }
  3194. defer googleapi.CloseBody(res)
  3195. if err := googleapi.CheckResponse(res); err != nil {
  3196. return nil, err
  3197. }
  3198. ret := &Empty{
  3199. ServerResponse: googleapi.ServerResponse{
  3200. Header: res.Header,
  3201. HTTPStatusCode: res.StatusCode,
  3202. },
  3203. }
  3204. target := &ret
  3205. if err := gensupport.DecodeResponse(target, res); err != nil {
  3206. return nil, err
  3207. }
  3208. return ret, nil
  3209. // {
  3210. // "description": "Deletes a device. This operation wipes the device.",
  3211. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}",
  3212. // "httpMethod": "DELETE",
  3213. // "id": "androidmanagement.enterprises.devices.delete",
  3214. // "parameterOrder": [
  3215. // "name"
  3216. // ],
  3217. // "parameters": {
  3218. // "name": {
  3219. // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.",
  3220. // "location": "path",
  3221. // "pattern": "^enterprises/[^/]+/devices/[^/]+$",
  3222. // "required": true,
  3223. // "type": "string"
  3224. // }
  3225. // },
  3226. // "path": "v1/{+name}",
  3227. // "response": {
  3228. // "$ref": "Empty"
  3229. // },
  3230. // "scopes": [
  3231. // "https://www.googleapis.com/auth/androidmanagement"
  3232. // ]
  3233. // }
  3234. }
  3235. // method id "androidmanagement.enterprises.devices.get":
  3236. type EnterprisesDevicesGetCall struct {
  3237. s *Service
  3238. name string
  3239. urlParams_ gensupport.URLParams
  3240. ifNoneMatch_ string
  3241. ctx_ context.Context
  3242. header_ http.Header
  3243. }
  3244. // Get: Gets a device.
  3245. func (r *EnterprisesDevicesService) Get(name string) *EnterprisesDevicesGetCall {
  3246. c := &EnterprisesDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3247. c.name = name
  3248. return c
  3249. }
  3250. // Fields allows partial responses to be retrieved. See
  3251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3252. // for more information.
  3253. func (c *EnterprisesDevicesGetCall) Fields(s ...googleapi.Field) *EnterprisesDevicesGetCall {
  3254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3255. return c
  3256. }
  3257. // IfNoneMatch sets the optional parameter which makes the operation
  3258. // fail if the object's ETag matches the given value. This is useful for
  3259. // getting updates only after the object has changed since the last
  3260. // request. Use googleapi.IsNotModified to check whether the response
  3261. // error from Do is the result of In-None-Match.
  3262. func (c *EnterprisesDevicesGetCall) IfNoneMatch(entityTag string) *EnterprisesDevicesGetCall {
  3263. c.ifNoneMatch_ = entityTag
  3264. return c
  3265. }
  3266. // Context sets the context to be used in this call's Do method. Any
  3267. // pending HTTP request will be aborted if the provided context is
  3268. // canceled.
  3269. func (c *EnterprisesDevicesGetCall) Context(ctx context.Context) *EnterprisesDevicesGetCall {
  3270. c.ctx_ = ctx
  3271. return c
  3272. }
  3273. // Header returns an http.Header that can be modified by the caller to
  3274. // add HTTP headers to the request.
  3275. func (c *EnterprisesDevicesGetCall) Header() http.Header {
  3276. if c.header_ == nil {
  3277. c.header_ = make(http.Header)
  3278. }
  3279. return c.header_
  3280. }
  3281. func (c *EnterprisesDevicesGetCall) doRequest(alt string) (*http.Response, error) {
  3282. reqHeaders := make(http.Header)
  3283. for k, v := range c.header_ {
  3284. reqHeaders[k] = v
  3285. }
  3286. reqHeaders.Set("User-Agent", c.s.userAgent())
  3287. if c.ifNoneMatch_ != "" {
  3288. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3289. }
  3290. var body io.Reader = nil
  3291. c.urlParams_.Set("alt", alt)
  3292. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3293. urls += "?" + c.urlParams_.Encode()
  3294. req, _ := http.NewRequest("GET", urls, body)
  3295. req.Header = reqHeaders
  3296. googleapi.Expand(req.URL, map[string]string{
  3297. "name": c.name,
  3298. })
  3299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3300. }
  3301. // Do executes the "androidmanagement.enterprises.devices.get" call.
  3302. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  3303. // code is an error. Response headers are in either
  3304. // *Device.ServerResponse.Header or (if a response was returned at all)
  3305. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3306. // check whether the returned error was because http.StatusNotModified
  3307. // was returned.
  3308. func (c *EnterprisesDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  3309. gensupport.SetOptions(c.urlParams_, opts...)
  3310. res, err := c.doRequest("json")
  3311. if res != nil && res.StatusCode == http.StatusNotModified {
  3312. if res.Body != nil {
  3313. res.Body.Close()
  3314. }
  3315. return nil, &googleapi.Error{
  3316. Code: res.StatusCode,
  3317. Header: res.Header,
  3318. }
  3319. }
  3320. if err != nil {
  3321. return nil, err
  3322. }
  3323. defer googleapi.CloseBody(res)
  3324. if err := googleapi.CheckResponse(res); err != nil {
  3325. return nil, err
  3326. }
  3327. ret := &Device{
  3328. ServerResponse: googleapi.ServerResponse{
  3329. Header: res.Header,
  3330. HTTPStatusCode: res.StatusCode,
  3331. },
  3332. }
  3333. target := &ret
  3334. if err := gensupport.DecodeResponse(target, res); err != nil {
  3335. return nil, err
  3336. }
  3337. return ret, nil
  3338. // {
  3339. // "description": "Gets a device.",
  3340. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}",
  3341. // "httpMethod": "GET",
  3342. // "id": "androidmanagement.enterprises.devices.get",
  3343. // "parameterOrder": [
  3344. // "name"
  3345. // ],
  3346. // "parameters": {
  3347. // "name": {
  3348. // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.",
  3349. // "location": "path",
  3350. // "pattern": "^enterprises/[^/]+/devices/[^/]+$",
  3351. // "required": true,
  3352. // "type": "string"
  3353. // }
  3354. // },
  3355. // "path": "v1/{+name}",
  3356. // "response": {
  3357. // "$ref": "Device"
  3358. // },
  3359. // "scopes": [
  3360. // "https://www.googleapis.com/auth/androidmanagement"
  3361. // ]
  3362. // }
  3363. }
  3364. // method id "androidmanagement.enterprises.devices.issueCommand":
  3365. type EnterprisesDevicesIssueCommandCall struct {
  3366. s *Service
  3367. name string
  3368. command *Command
  3369. urlParams_ gensupport.URLParams
  3370. ctx_ context.Context
  3371. header_ http.Header
  3372. }
  3373. // IssueCommand: Issues a command to a device. The Operation resource
  3374. // returned contains a Command in its metadata field. Use the get
  3375. // operation method to get the status of the command.
  3376. func (r *EnterprisesDevicesService) IssueCommand(name string, command *Command) *EnterprisesDevicesIssueCommandCall {
  3377. c := &EnterprisesDevicesIssueCommandCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3378. c.name = name
  3379. c.command = command
  3380. return c
  3381. }
  3382. // Fields allows partial responses to be retrieved. See
  3383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3384. // for more information.
  3385. func (c *EnterprisesDevicesIssueCommandCall) Fields(s ...googleapi.Field) *EnterprisesDevicesIssueCommandCall {
  3386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3387. return c
  3388. }
  3389. // Context sets the context to be used in this call's Do method. Any
  3390. // pending HTTP request will be aborted if the provided context is
  3391. // canceled.
  3392. func (c *EnterprisesDevicesIssueCommandCall) Context(ctx context.Context) *EnterprisesDevicesIssueCommandCall {
  3393. c.ctx_ = ctx
  3394. return c
  3395. }
  3396. // Header returns an http.Header that can be modified by the caller to
  3397. // add HTTP headers to the request.
  3398. func (c *EnterprisesDevicesIssueCommandCall) Header() http.Header {
  3399. if c.header_ == nil {
  3400. c.header_ = make(http.Header)
  3401. }
  3402. return c.header_
  3403. }
  3404. func (c *EnterprisesDevicesIssueCommandCall) doRequest(alt string) (*http.Response, error) {
  3405. reqHeaders := make(http.Header)
  3406. for k, v := range c.header_ {
  3407. reqHeaders[k] = v
  3408. }
  3409. reqHeaders.Set("User-Agent", c.s.userAgent())
  3410. var body io.Reader = nil
  3411. body, err := googleapi.WithoutDataWrapper.JSONReader(c.command)
  3412. if err != nil {
  3413. return nil, err
  3414. }
  3415. reqHeaders.Set("Content-Type", "application/json")
  3416. c.urlParams_.Set("alt", alt)
  3417. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:issueCommand")
  3418. urls += "?" + c.urlParams_.Encode()
  3419. req, _ := http.NewRequest("POST", urls, body)
  3420. req.Header = reqHeaders
  3421. googleapi.Expand(req.URL, map[string]string{
  3422. "name": c.name,
  3423. })
  3424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3425. }
  3426. // Do executes the "androidmanagement.enterprises.devices.issueCommand" call.
  3427. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3428. // status code is an error. Response headers are in either
  3429. // *Operation.ServerResponse.Header or (if a response was returned at
  3430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3431. // to check whether the returned error was because
  3432. // http.StatusNotModified was returned.
  3433. func (c *EnterprisesDevicesIssueCommandCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3434. gensupport.SetOptions(c.urlParams_, opts...)
  3435. res, err := c.doRequest("json")
  3436. if res != nil && res.StatusCode == http.StatusNotModified {
  3437. if res.Body != nil {
  3438. res.Body.Close()
  3439. }
  3440. return nil, &googleapi.Error{
  3441. Code: res.StatusCode,
  3442. Header: res.Header,
  3443. }
  3444. }
  3445. if err != nil {
  3446. return nil, err
  3447. }
  3448. defer googleapi.CloseBody(res)
  3449. if err := googleapi.CheckResponse(res); err != nil {
  3450. return nil, err
  3451. }
  3452. ret := &Operation{
  3453. ServerResponse: googleapi.ServerResponse{
  3454. Header: res.Header,
  3455. HTTPStatusCode: res.StatusCode,
  3456. },
  3457. }
  3458. target := &ret
  3459. if err := gensupport.DecodeResponse(target, res); err != nil {
  3460. return nil, err
  3461. }
  3462. return ret, nil
  3463. // {
  3464. // "description": "Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status of the command.",
  3465. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}:issueCommand",
  3466. // "httpMethod": "POST",
  3467. // "id": "androidmanagement.enterprises.devices.issueCommand",
  3468. // "parameterOrder": [
  3469. // "name"
  3470. // ],
  3471. // "parameters": {
  3472. // "name": {
  3473. // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.",
  3474. // "location": "path",
  3475. // "pattern": "^enterprises/[^/]+/devices/[^/]+$",
  3476. // "required": true,
  3477. // "type": "string"
  3478. // }
  3479. // },
  3480. // "path": "v1/{+name}:issueCommand",
  3481. // "request": {
  3482. // "$ref": "Command"
  3483. // },
  3484. // "response": {
  3485. // "$ref": "Operation"
  3486. // },
  3487. // "scopes": [
  3488. // "https://www.googleapis.com/auth/androidmanagement"
  3489. // ]
  3490. // }
  3491. }
  3492. // method id "androidmanagement.enterprises.devices.list":
  3493. type EnterprisesDevicesListCall struct {
  3494. s *Service
  3495. parent string
  3496. urlParams_ gensupport.URLParams
  3497. ifNoneMatch_ string
  3498. ctx_ context.Context
  3499. header_ http.Header
  3500. }
  3501. // List: Lists devices for a given enterprise.
  3502. func (r *EnterprisesDevicesService) List(parent string) *EnterprisesDevicesListCall {
  3503. c := &EnterprisesDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3504. c.parent = parent
  3505. return c
  3506. }
  3507. // PageSize sets the optional parameter "pageSize": The requested page
  3508. // size. The actual page size may be fixed to a min or max value.
  3509. func (c *EnterprisesDevicesListCall) PageSize(pageSize int64) *EnterprisesDevicesListCall {
  3510. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3511. return c
  3512. }
  3513. // PageToken sets the optional parameter "pageToken": A token
  3514. // identifying a page of results returned by the server.
  3515. func (c *EnterprisesDevicesListCall) PageToken(pageToken string) *EnterprisesDevicesListCall {
  3516. c.urlParams_.Set("pageToken", pageToken)
  3517. return c
  3518. }
  3519. // Fields allows partial responses to be retrieved. See
  3520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3521. // for more information.
  3522. func (c *EnterprisesDevicesListCall) Fields(s ...googleapi.Field) *EnterprisesDevicesListCall {
  3523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3524. return c
  3525. }
  3526. // IfNoneMatch sets the optional parameter which makes the operation
  3527. // fail if the object's ETag matches the given value. This is useful for
  3528. // getting updates only after the object has changed since the last
  3529. // request. Use googleapi.IsNotModified to check whether the response
  3530. // error from Do is the result of In-None-Match.
  3531. func (c *EnterprisesDevicesListCall) IfNoneMatch(entityTag string) *EnterprisesDevicesListCall {
  3532. c.ifNoneMatch_ = entityTag
  3533. return c
  3534. }
  3535. // Context sets the context to be used in this call's Do method. Any
  3536. // pending HTTP request will be aborted if the provided context is
  3537. // canceled.
  3538. func (c *EnterprisesDevicesListCall) Context(ctx context.Context) *EnterprisesDevicesListCall {
  3539. c.ctx_ = ctx
  3540. return c
  3541. }
  3542. // Header returns an http.Header that can be modified by the caller to
  3543. // add HTTP headers to the request.
  3544. func (c *EnterprisesDevicesListCall) Header() http.Header {
  3545. if c.header_ == nil {
  3546. c.header_ = make(http.Header)
  3547. }
  3548. return c.header_
  3549. }
  3550. func (c *EnterprisesDevicesListCall) doRequest(alt string) (*http.Response, error) {
  3551. reqHeaders := make(http.Header)
  3552. for k, v := range c.header_ {
  3553. reqHeaders[k] = v
  3554. }
  3555. reqHeaders.Set("User-Agent", c.s.userAgent())
  3556. if c.ifNoneMatch_ != "" {
  3557. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3558. }
  3559. var body io.Reader = nil
  3560. c.urlParams_.Set("alt", alt)
  3561. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices")
  3562. urls += "?" + c.urlParams_.Encode()
  3563. req, _ := http.NewRequest("GET", urls, body)
  3564. req.Header = reqHeaders
  3565. googleapi.Expand(req.URL, map[string]string{
  3566. "parent": c.parent,
  3567. })
  3568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3569. }
  3570. // Do executes the "androidmanagement.enterprises.devices.list" call.
  3571. // Exactly one of *ListDevicesResponse or error will be non-nil. Any
  3572. // non-2xx status code is an error. Response headers are in either
  3573. // *ListDevicesResponse.ServerResponse.Header or (if a response was
  3574. // returned at all) in error.(*googleapi.Error).Header. Use
  3575. // googleapi.IsNotModified to check whether the returned error was
  3576. // because http.StatusNotModified was returned.
  3577. func (c *EnterprisesDevicesListCall) Do(opts ...googleapi.CallOption) (*ListDevicesResponse, error) {
  3578. gensupport.SetOptions(c.urlParams_, opts...)
  3579. res, err := c.doRequest("json")
  3580. if res != nil && res.StatusCode == http.StatusNotModified {
  3581. if res.Body != nil {
  3582. res.Body.Close()
  3583. }
  3584. return nil, &googleapi.Error{
  3585. Code: res.StatusCode,
  3586. Header: res.Header,
  3587. }
  3588. }
  3589. if err != nil {
  3590. return nil, err
  3591. }
  3592. defer googleapi.CloseBody(res)
  3593. if err := googleapi.CheckResponse(res); err != nil {
  3594. return nil, err
  3595. }
  3596. ret := &ListDevicesResponse{
  3597. ServerResponse: googleapi.ServerResponse{
  3598. Header: res.Header,
  3599. HTTPStatusCode: res.StatusCode,
  3600. },
  3601. }
  3602. target := &ret
  3603. if err := gensupport.DecodeResponse(target, res); err != nil {
  3604. return nil, err
  3605. }
  3606. return ret, nil
  3607. // {
  3608. // "description": "Lists devices for a given enterprise.",
  3609. // "flatPath": "v1/enterprises/{enterprisesId}/devices",
  3610. // "httpMethod": "GET",
  3611. // "id": "androidmanagement.enterprises.devices.list",
  3612. // "parameterOrder": [
  3613. // "parent"
  3614. // ],
  3615. // "parameters": {
  3616. // "pageSize": {
  3617. // "description": "The requested page size. The actual page size may be fixed to a min or max value.",
  3618. // "format": "int32",
  3619. // "location": "query",
  3620. // "type": "integer"
  3621. // },
  3622. // "pageToken": {
  3623. // "description": "A token identifying a page of results returned by the server.",
  3624. // "location": "query",
  3625. // "type": "string"
  3626. // },
  3627. // "parent": {
  3628. // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.",
  3629. // "location": "path",
  3630. // "pattern": "^enterprises/[^/]+$",
  3631. // "required": true,
  3632. // "type": "string"
  3633. // }
  3634. // },
  3635. // "path": "v1/{+parent}/devices",
  3636. // "response": {
  3637. // "$ref": "ListDevicesResponse"
  3638. // },
  3639. // "scopes": [
  3640. // "https://www.googleapis.com/auth/androidmanagement"
  3641. // ]
  3642. // }
  3643. }
  3644. // Pages invokes f for each page of results.
  3645. // A non-nil error returned from f will halt the iteration.
  3646. // The provided context supersedes any context provided to the Context method.
  3647. func (c *EnterprisesDevicesListCall) Pages(ctx context.Context, f func(*ListDevicesResponse) error) error {
  3648. c.ctx_ = ctx
  3649. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3650. for {
  3651. x, err := c.Do()
  3652. if err != nil {
  3653. return err
  3654. }
  3655. if err := f(x); err != nil {
  3656. return err
  3657. }
  3658. if x.NextPageToken == "" {
  3659. return nil
  3660. }
  3661. c.PageToken(x.NextPageToken)
  3662. }
  3663. }
  3664. // method id "androidmanagement.enterprises.devices.patch":
  3665. type EnterprisesDevicesPatchCall struct {
  3666. s *Service
  3667. name string
  3668. device *Device
  3669. urlParams_ gensupport.URLParams
  3670. ctx_ context.Context
  3671. header_ http.Header
  3672. }
  3673. // Patch: Updates a device.
  3674. func (r *EnterprisesDevicesService) Patch(name string, device *Device) *EnterprisesDevicesPatchCall {
  3675. c := &EnterprisesDevicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3676. c.name = name
  3677. c.device = device
  3678. return c
  3679. }
  3680. // UpdateMask sets the optional parameter "updateMask": The field mask
  3681. // indicating the fields to update. If not set, all modifiable fields
  3682. // will be modified.
  3683. func (c *EnterprisesDevicesPatchCall) UpdateMask(updateMask string) *EnterprisesDevicesPatchCall {
  3684. c.urlParams_.Set("updateMask", updateMask)
  3685. return c
  3686. }
  3687. // Fields allows partial responses to be retrieved. See
  3688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3689. // for more information.
  3690. func (c *EnterprisesDevicesPatchCall) Fields(s ...googleapi.Field) *EnterprisesDevicesPatchCall {
  3691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3692. return c
  3693. }
  3694. // Context sets the context to be used in this call's Do method. Any
  3695. // pending HTTP request will be aborted if the provided context is
  3696. // canceled.
  3697. func (c *EnterprisesDevicesPatchCall) Context(ctx context.Context) *EnterprisesDevicesPatchCall {
  3698. c.ctx_ = ctx
  3699. return c
  3700. }
  3701. // Header returns an http.Header that can be modified by the caller to
  3702. // add HTTP headers to the request.
  3703. func (c *EnterprisesDevicesPatchCall) Header() http.Header {
  3704. if c.header_ == nil {
  3705. c.header_ = make(http.Header)
  3706. }
  3707. return c.header_
  3708. }
  3709. func (c *EnterprisesDevicesPatchCall) doRequest(alt string) (*http.Response, error) {
  3710. reqHeaders := make(http.Header)
  3711. for k, v := range c.header_ {
  3712. reqHeaders[k] = v
  3713. }
  3714. reqHeaders.Set("User-Agent", c.s.userAgent())
  3715. var body io.Reader = nil
  3716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.device)
  3717. if err != nil {
  3718. return nil, err
  3719. }
  3720. reqHeaders.Set("Content-Type", "application/json")
  3721. c.urlParams_.Set("alt", alt)
  3722. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3723. urls += "?" + c.urlParams_.Encode()
  3724. req, _ := http.NewRequest("PATCH", urls, body)
  3725. req.Header = reqHeaders
  3726. googleapi.Expand(req.URL, map[string]string{
  3727. "name": c.name,
  3728. })
  3729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3730. }
  3731. // Do executes the "androidmanagement.enterprises.devices.patch" call.
  3732. // Exactly one of *Device or error will be non-nil. Any non-2xx status
  3733. // code is an error. Response headers are in either
  3734. // *Device.ServerResponse.Header or (if a response was returned at all)
  3735. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3736. // check whether the returned error was because http.StatusNotModified
  3737. // was returned.
  3738. func (c *EnterprisesDevicesPatchCall) Do(opts ...googleapi.CallOption) (*Device, error) {
  3739. gensupport.SetOptions(c.urlParams_, opts...)
  3740. res, err := c.doRequest("json")
  3741. if res != nil && res.StatusCode == http.StatusNotModified {
  3742. if res.Body != nil {
  3743. res.Body.Close()
  3744. }
  3745. return nil, &googleapi.Error{
  3746. Code: res.StatusCode,
  3747. Header: res.Header,
  3748. }
  3749. }
  3750. if err != nil {
  3751. return nil, err
  3752. }
  3753. defer googleapi.CloseBody(res)
  3754. if err := googleapi.CheckResponse(res); err != nil {
  3755. return nil, err
  3756. }
  3757. ret := &Device{
  3758. ServerResponse: googleapi.ServerResponse{
  3759. Header: res.Header,
  3760. HTTPStatusCode: res.StatusCode,
  3761. },
  3762. }
  3763. target := &ret
  3764. if err := gensupport.DecodeResponse(target, res); err != nil {
  3765. return nil, err
  3766. }
  3767. return ret, nil
  3768. // {
  3769. // "description": "Updates a device.",
  3770. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}",
  3771. // "httpMethod": "PATCH",
  3772. // "id": "androidmanagement.enterprises.devices.patch",
  3773. // "parameterOrder": [
  3774. // "name"
  3775. // ],
  3776. // "parameters": {
  3777. // "name": {
  3778. // "description": "The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.",
  3779. // "location": "path",
  3780. // "pattern": "^enterprises/[^/]+/devices/[^/]+$",
  3781. // "required": true,
  3782. // "type": "string"
  3783. // },
  3784. // "updateMask": {
  3785. // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.",
  3786. // "format": "google-fieldmask",
  3787. // "location": "query",
  3788. // "type": "string"
  3789. // }
  3790. // },
  3791. // "path": "v1/{+name}",
  3792. // "request": {
  3793. // "$ref": "Device"
  3794. // },
  3795. // "response": {
  3796. // "$ref": "Device"
  3797. // },
  3798. // "scopes": [
  3799. // "https://www.googleapis.com/auth/androidmanagement"
  3800. // ]
  3801. // }
  3802. }
  3803. // method id "androidmanagement.enterprises.devices.operations.cancel":
  3804. type EnterprisesDevicesOperationsCancelCall struct {
  3805. s *Service
  3806. name string
  3807. urlParams_ gensupport.URLParams
  3808. ctx_ context.Context
  3809. header_ http.Header
  3810. }
  3811. // Cancel: Starts asynchronous cancellation on a long-running operation.
  3812. // The server makes a best effort to cancel the operation, but success
  3813. // is not guaranteed. If the server doesn't support this method, it
  3814. // returns google.rpc.Code.UNIMPLEMENTED. Clients can use
  3815. // Operations.GetOperation or other methods to check whether the
  3816. // cancellation succeeded or whether the operation completed despite
  3817. // cancellation. On successful cancellation, the operation is not
  3818. // deleted; instead, it becomes an operation with an Operation.error
  3819. // value with a google.rpc.Status.code of 1, corresponding to
  3820. // Code.CANCELLED.
  3821. func (r *EnterprisesDevicesOperationsService) Cancel(name string) *EnterprisesDevicesOperationsCancelCall {
  3822. c := &EnterprisesDevicesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3823. c.name = name
  3824. return c
  3825. }
  3826. // Fields allows partial responses to be retrieved. See
  3827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3828. // for more information.
  3829. func (c *EnterprisesDevicesOperationsCancelCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsCancelCall {
  3830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3831. return c
  3832. }
  3833. // Context sets the context to be used in this call's Do method. Any
  3834. // pending HTTP request will be aborted if the provided context is
  3835. // canceled.
  3836. func (c *EnterprisesDevicesOperationsCancelCall) Context(ctx context.Context) *EnterprisesDevicesOperationsCancelCall {
  3837. c.ctx_ = ctx
  3838. return c
  3839. }
  3840. // Header returns an http.Header that can be modified by the caller to
  3841. // add HTTP headers to the request.
  3842. func (c *EnterprisesDevicesOperationsCancelCall) Header() http.Header {
  3843. if c.header_ == nil {
  3844. c.header_ = make(http.Header)
  3845. }
  3846. return c.header_
  3847. }
  3848. func (c *EnterprisesDevicesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  3849. reqHeaders := make(http.Header)
  3850. for k, v := range c.header_ {
  3851. reqHeaders[k] = v
  3852. }
  3853. reqHeaders.Set("User-Agent", c.s.userAgent())
  3854. var body io.Reader = nil
  3855. c.urlParams_.Set("alt", alt)
  3856. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  3857. urls += "?" + c.urlParams_.Encode()
  3858. req, _ := http.NewRequest("POST", urls, body)
  3859. req.Header = reqHeaders
  3860. googleapi.Expand(req.URL, map[string]string{
  3861. "name": c.name,
  3862. })
  3863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3864. }
  3865. // Do executes the "androidmanagement.enterprises.devices.operations.cancel" call.
  3866. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3867. // code is an error. Response headers are in either
  3868. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3869. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3870. // check whether the returned error was because http.StatusNotModified
  3871. // was returned.
  3872. func (c *EnterprisesDevicesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3873. gensupport.SetOptions(c.urlParams_, opts...)
  3874. res, err := c.doRequest("json")
  3875. if res != nil && res.StatusCode == http.StatusNotModified {
  3876. if res.Body != nil {
  3877. res.Body.Close()
  3878. }
  3879. return nil, &googleapi.Error{
  3880. Code: res.StatusCode,
  3881. Header: res.Header,
  3882. }
  3883. }
  3884. if err != nil {
  3885. return nil, err
  3886. }
  3887. defer googleapi.CloseBody(res)
  3888. if err := googleapi.CheckResponse(res); err != nil {
  3889. return nil, err
  3890. }
  3891. ret := &Empty{
  3892. ServerResponse: googleapi.ServerResponse{
  3893. Header: res.Header,
  3894. HTTPStatusCode: res.StatusCode,
  3895. },
  3896. }
  3897. target := &ret
  3898. if err := gensupport.DecodeResponse(target, res); err != nil {
  3899. return nil, err
  3900. }
  3901. return ret, nil
  3902. // {
  3903. // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.",
  3904. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}:cancel",
  3905. // "httpMethod": "POST",
  3906. // "id": "androidmanagement.enterprises.devices.operations.cancel",
  3907. // "parameterOrder": [
  3908. // "name"
  3909. // ],
  3910. // "parameters": {
  3911. // "name": {
  3912. // "description": "The name of the operation resource to be cancelled.",
  3913. // "location": "path",
  3914. // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$",
  3915. // "required": true,
  3916. // "type": "string"
  3917. // }
  3918. // },
  3919. // "path": "v1/{+name}:cancel",
  3920. // "response": {
  3921. // "$ref": "Empty"
  3922. // },
  3923. // "scopes": [
  3924. // "https://www.googleapis.com/auth/androidmanagement"
  3925. // ]
  3926. // }
  3927. }
  3928. // method id "androidmanagement.enterprises.devices.operations.delete":
  3929. type EnterprisesDevicesOperationsDeleteCall struct {
  3930. s *Service
  3931. name string
  3932. urlParams_ gensupport.URLParams
  3933. ctx_ context.Context
  3934. header_ http.Header
  3935. }
  3936. // Delete: Deletes a long-running operation. This method indicates that
  3937. // the client is no longer interested in the operation result. It does
  3938. // not cancel the operation. If the server doesn't support this method,
  3939. // it returns google.rpc.Code.UNIMPLEMENTED.
  3940. func (r *EnterprisesDevicesOperationsService) Delete(name string) *EnterprisesDevicesOperationsDeleteCall {
  3941. c := &EnterprisesDevicesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3942. c.name = name
  3943. return c
  3944. }
  3945. // Fields allows partial responses to be retrieved. See
  3946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3947. // for more information.
  3948. func (c *EnterprisesDevicesOperationsDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsDeleteCall {
  3949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3950. return c
  3951. }
  3952. // Context sets the context to be used in this call's Do method. Any
  3953. // pending HTTP request will be aborted if the provided context is
  3954. // canceled.
  3955. func (c *EnterprisesDevicesOperationsDeleteCall) Context(ctx context.Context) *EnterprisesDevicesOperationsDeleteCall {
  3956. c.ctx_ = ctx
  3957. return c
  3958. }
  3959. // Header returns an http.Header that can be modified by the caller to
  3960. // add HTTP headers to the request.
  3961. func (c *EnterprisesDevicesOperationsDeleteCall) Header() http.Header {
  3962. if c.header_ == nil {
  3963. c.header_ = make(http.Header)
  3964. }
  3965. return c.header_
  3966. }
  3967. func (c *EnterprisesDevicesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3968. reqHeaders := make(http.Header)
  3969. for k, v := range c.header_ {
  3970. reqHeaders[k] = v
  3971. }
  3972. reqHeaders.Set("User-Agent", c.s.userAgent())
  3973. var body io.Reader = nil
  3974. c.urlParams_.Set("alt", alt)
  3975. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3976. urls += "?" + c.urlParams_.Encode()
  3977. req, _ := http.NewRequest("DELETE", urls, body)
  3978. req.Header = reqHeaders
  3979. googleapi.Expand(req.URL, map[string]string{
  3980. "name": c.name,
  3981. })
  3982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3983. }
  3984. // Do executes the "androidmanagement.enterprises.devices.operations.delete" call.
  3985. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3986. // code is an error. Response headers are in either
  3987. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3988. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3989. // check whether the returned error was because http.StatusNotModified
  3990. // was returned.
  3991. func (c *EnterprisesDevicesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3992. gensupport.SetOptions(c.urlParams_, opts...)
  3993. res, err := c.doRequest("json")
  3994. if res != nil && res.StatusCode == http.StatusNotModified {
  3995. if res.Body != nil {
  3996. res.Body.Close()
  3997. }
  3998. return nil, &googleapi.Error{
  3999. Code: res.StatusCode,
  4000. Header: res.Header,
  4001. }
  4002. }
  4003. if err != nil {
  4004. return nil, err
  4005. }
  4006. defer googleapi.CloseBody(res)
  4007. if err := googleapi.CheckResponse(res); err != nil {
  4008. return nil, err
  4009. }
  4010. ret := &Empty{
  4011. ServerResponse: googleapi.ServerResponse{
  4012. Header: res.Header,
  4013. HTTPStatusCode: res.StatusCode,
  4014. },
  4015. }
  4016. target := &ret
  4017. if err := gensupport.DecodeResponse(target, res); err != nil {
  4018. return nil, err
  4019. }
  4020. return ret, nil
  4021. // {
  4022. // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.",
  4023. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}",
  4024. // "httpMethod": "DELETE",
  4025. // "id": "androidmanagement.enterprises.devices.operations.delete",
  4026. // "parameterOrder": [
  4027. // "name"
  4028. // ],
  4029. // "parameters": {
  4030. // "name": {
  4031. // "description": "The name of the operation resource to be deleted.",
  4032. // "location": "path",
  4033. // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$",
  4034. // "required": true,
  4035. // "type": "string"
  4036. // }
  4037. // },
  4038. // "path": "v1/{+name}",
  4039. // "response": {
  4040. // "$ref": "Empty"
  4041. // },
  4042. // "scopes": [
  4043. // "https://www.googleapis.com/auth/androidmanagement"
  4044. // ]
  4045. // }
  4046. }
  4047. // method id "androidmanagement.enterprises.devices.operations.get":
  4048. type EnterprisesDevicesOperationsGetCall struct {
  4049. s *Service
  4050. name string
  4051. urlParams_ gensupport.URLParams
  4052. ifNoneMatch_ string
  4053. ctx_ context.Context
  4054. header_ http.Header
  4055. }
  4056. // Get: Gets the latest state of a long-running operation. Clients can
  4057. // use this method to poll the operation result at intervals as
  4058. // recommended by the API service.
  4059. func (r *EnterprisesDevicesOperationsService) Get(name string) *EnterprisesDevicesOperationsGetCall {
  4060. c := &EnterprisesDevicesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4061. c.name = name
  4062. return c
  4063. }
  4064. // Fields allows partial responses to be retrieved. See
  4065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4066. // for more information.
  4067. func (c *EnterprisesDevicesOperationsGetCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsGetCall {
  4068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4069. return c
  4070. }
  4071. // IfNoneMatch sets the optional parameter which makes the operation
  4072. // fail if the object's ETag matches the given value. This is useful for
  4073. // getting updates only after the object has changed since the last
  4074. // request. Use googleapi.IsNotModified to check whether the response
  4075. // error from Do is the result of In-None-Match.
  4076. func (c *EnterprisesDevicesOperationsGetCall) IfNoneMatch(entityTag string) *EnterprisesDevicesOperationsGetCall {
  4077. c.ifNoneMatch_ = entityTag
  4078. return c
  4079. }
  4080. // Context sets the context to be used in this call's Do method. Any
  4081. // pending HTTP request will be aborted if the provided context is
  4082. // canceled.
  4083. func (c *EnterprisesDevicesOperationsGetCall) Context(ctx context.Context) *EnterprisesDevicesOperationsGetCall {
  4084. c.ctx_ = ctx
  4085. return c
  4086. }
  4087. // Header returns an http.Header that can be modified by the caller to
  4088. // add HTTP headers to the request.
  4089. func (c *EnterprisesDevicesOperationsGetCall) Header() http.Header {
  4090. if c.header_ == nil {
  4091. c.header_ = make(http.Header)
  4092. }
  4093. return c.header_
  4094. }
  4095. func (c *EnterprisesDevicesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4096. reqHeaders := make(http.Header)
  4097. for k, v := range c.header_ {
  4098. reqHeaders[k] = v
  4099. }
  4100. reqHeaders.Set("User-Agent", c.s.userAgent())
  4101. if c.ifNoneMatch_ != "" {
  4102. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4103. }
  4104. var body io.Reader = nil
  4105. c.urlParams_.Set("alt", alt)
  4106. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4107. urls += "?" + c.urlParams_.Encode()
  4108. req, _ := http.NewRequest("GET", urls, body)
  4109. req.Header = reqHeaders
  4110. googleapi.Expand(req.URL, map[string]string{
  4111. "name": c.name,
  4112. })
  4113. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4114. }
  4115. // Do executes the "androidmanagement.enterprises.devices.operations.get" call.
  4116. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4117. // status code is an error. Response headers are in either
  4118. // *Operation.ServerResponse.Header or (if a response was returned at
  4119. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4120. // to check whether the returned error was because
  4121. // http.StatusNotModified was returned.
  4122. func (c *EnterprisesDevicesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4123. gensupport.SetOptions(c.urlParams_, opts...)
  4124. res, err := c.doRequest("json")
  4125. if res != nil && res.StatusCode == http.StatusNotModified {
  4126. if res.Body != nil {
  4127. res.Body.Close()
  4128. }
  4129. return nil, &googleapi.Error{
  4130. Code: res.StatusCode,
  4131. Header: res.Header,
  4132. }
  4133. }
  4134. if err != nil {
  4135. return nil, err
  4136. }
  4137. defer googleapi.CloseBody(res)
  4138. if err := googleapi.CheckResponse(res); err != nil {
  4139. return nil, err
  4140. }
  4141. ret := &Operation{
  4142. ServerResponse: googleapi.ServerResponse{
  4143. Header: res.Header,
  4144. HTTPStatusCode: res.StatusCode,
  4145. },
  4146. }
  4147. target := &ret
  4148. if err := gensupport.DecodeResponse(target, res); err != nil {
  4149. return nil, err
  4150. }
  4151. return ret, nil
  4152. // {
  4153. // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
  4154. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations/{operationsId}",
  4155. // "httpMethod": "GET",
  4156. // "id": "androidmanagement.enterprises.devices.operations.get",
  4157. // "parameterOrder": [
  4158. // "name"
  4159. // ],
  4160. // "parameters": {
  4161. // "name": {
  4162. // "description": "The name of the operation resource.",
  4163. // "location": "path",
  4164. // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$",
  4165. // "required": true,
  4166. // "type": "string"
  4167. // }
  4168. // },
  4169. // "path": "v1/{+name}",
  4170. // "response": {
  4171. // "$ref": "Operation"
  4172. // },
  4173. // "scopes": [
  4174. // "https://www.googleapis.com/auth/androidmanagement"
  4175. // ]
  4176. // }
  4177. }
  4178. // method id "androidmanagement.enterprises.devices.operations.list":
  4179. type EnterprisesDevicesOperationsListCall struct {
  4180. s *Service
  4181. name string
  4182. urlParams_ gensupport.URLParams
  4183. ifNoneMatch_ string
  4184. ctx_ context.Context
  4185. header_ http.Header
  4186. }
  4187. // List: Lists operations that match the specified filter in the
  4188. // request. If the server doesn't support this method, it returns
  4189. // UNIMPLEMENTED.NOTE: the name binding allows API services to override
  4190. // the binding to use different resource name schemes, such as
  4191. // users/*/operations. To override the binding, API services can add a
  4192. // binding such as "/v1/{name=users/*}/operations" to their service
  4193. // configuration. For backwards compatibility, the default name includes
  4194. // the operations collection id, however overriding users must ensure
  4195. // the name binding is the parent resource, without the operations
  4196. // collection id.
  4197. func (r *EnterprisesDevicesOperationsService) List(name string) *EnterprisesDevicesOperationsListCall {
  4198. c := &EnterprisesDevicesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4199. c.name = name
  4200. return c
  4201. }
  4202. // Filter sets the optional parameter "filter": The standard list
  4203. // filter.
  4204. func (c *EnterprisesDevicesOperationsListCall) Filter(filter string) *EnterprisesDevicesOperationsListCall {
  4205. c.urlParams_.Set("filter", filter)
  4206. return c
  4207. }
  4208. // PageSize sets the optional parameter "pageSize": The standard list
  4209. // page size.
  4210. func (c *EnterprisesDevicesOperationsListCall) PageSize(pageSize int64) *EnterprisesDevicesOperationsListCall {
  4211. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4212. return c
  4213. }
  4214. // PageToken sets the optional parameter "pageToken": The standard list
  4215. // page token.
  4216. func (c *EnterprisesDevicesOperationsListCall) PageToken(pageToken string) *EnterprisesDevicesOperationsListCall {
  4217. c.urlParams_.Set("pageToken", pageToken)
  4218. return c
  4219. }
  4220. // Fields allows partial responses to be retrieved. See
  4221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4222. // for more information.
  4223. func (c *EnterprisesDevicesOperationsListCall) Fields(s ...googleapi.Field) *EnterprisesDevicesOperationsListCall {
  4224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4225. return c
  4226. }
  4227. // IfNoneMatch sets the optional parameter which makes the operation
  4228. // fail if the object's ETag matches the given value. This is useful for
  4229. // getting updates only after the object has changed since the last
  4230. // request. Use googleapi.IsNotModified to check whether the response
  4231. // error from Do is the result of In-None-Match.
  4232. func (c *EnterprisesDevicesOperationsListCall) IfNoneMatch(entityTag string) *EnterprisesDevicesOperationsListCall {
  4233. c.ifNoneMatch_ = entityTag
  4234. return c
  4235. }
  4236. // Context sets the context to be used in this call's Do method. Any
  4237. // pending HTTP request will be aborted if the provided context is
  4238. // canceled.
  4239. func (c *EnterprisesDevicesOperationsListCall) Context(ctx context.Context) *EnterprisesDevicesOperationsListCall {
  4240. c.ctx_ = ctx
  4241. return c
  4242. }
  4243. // Header returns an http.Header that can be modified by the caller to
  4244. // add HTTP headers to the request.
  4245. func (c *EnterprisesDevicesOperationsListCall) Header() http.Header {
  4246. if c.header_ == nil {
  4247. c.header_ = make(http.Header)
  4248. }
  4249. return c.header_
  4250. }
  4251. func (c *EnterprisesDevicesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  4252. reqHeaders := make(http.Header)
  4253. for k, v := range c.header_ {
  4254. reqHeaders[k] = v
  4255. }
  4256. reqHeaders.Set("User-Agent", c.s.userAgent())
  4257. if c.ifNoneMatch_ != "" {
  4258. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4259. }
  4260. var body io.Reader = nil
  4261. c.urlParams_.Set("alt", alt)
  4262. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4263. urls += "?" + c.urlParams_.Encode()
  4264. req, _ := http.NewRequest("GET", urls, body)
  4265. req.Header = reqHeaders
  4266. googleapi.Expand(req.URL, map[string]string{
  4267. "name": c.name,
  4268. })
  4269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4270. }
  4271. // Do executes the "androidmanagement.enterprises.devices.operations.list" call.
  4272. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  4273. // non-2xx status code is an error. Response headers are in either
  4274. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  4275. // returned at all) in error.(*googleapi.Error).Header. Use
  4276. // googleapi.IsNotModified to check whether the returned error was
  4277. // because http.StatusNotModified was returned.
  4278. func (c *EnterprisesDevicesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  4279. gensupport.SetOptions(c.urlParams_, opts...)
  4280. res, err := c.doRequest("json")
  4281. if res != nil && res.StatusCode == http.StatusNotModified {
  4282. if res.Body != nil {
  4283. res.Body.Close()
  4284. }
  4285. return nil, &googleapi.Error{
  4286. Code: res.StatusCode,
  4287. Header: res.Header,
  4288. }
  4289. }
  4290. if err != nil {
  4291. return nil, err
  4292. }
  4293. defer googleapi.CloseBody(res)
  4294. if err := googleapi.CheckResponse(res); err != nil {
  4295. return nil, err
  4296. }
  4297. ret := &ListOperationsResponse{
  4298. ServerResponse: googleapi.ServerResponse{
  4299. Header: res.Header,
  4300. HTTPStatusCode: res.StatusCode,
  4301. },
  4302. }
  4303. target := &ret
  4304. if err := gensupport.DecodeResponse(target, res); err != nil {
  4305. return nil, err
  4306. }
  4307. return ret, nil
  4308. // {
  4309. // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
  4310. // "flatPath": "v1/enterprises/{enterprisesId}/devices/{devicesId}/operations",
  4311. // "httpMethod": "GET",
  4312. // "id": "androidmanagement.enterprises.devices.operations.list",
  4313. // "parameterOrder": [
  4314. // "name"
  4315. // ],
  4316. // "parameters": {
  4317. // "filter": {
  4318. // "description": "The standard list filter.",
  4319. // "location": "query",
  4320. // "type": "string"
  4321. // },
  4322. // "name": {
  4323. // "description": "The name of the operation's parent resource.",
  4324. // "location": "path",
  4325. // "pattern": "^enterprises/[^/]+/devices/[^/]+/operations$",
  4326. // "required": true,
  4327. // "type": "string"
  4328. // },
  4329. // "pageSize": {
  4330. // "description": "The standard list page size.",
  4331. // "format": "int32",
  4332. // "location": "query",
  4333. // "type": "integer"
  4334. // },
  4335. // "pageToken": {
  4336. // "description": "The standard list page token.",
  4337. // "location": "query",
  4338. // "type": "string"
  4339. // }
  4340. // },
  4341. // "path": "v1/{+name}",
  4342. // "response": {
  4343. // "$ref": "ListOperationsResponse"
  4344. // },
  4345. // "scopes": [
  4346. // "https://www.googleapis.com/auth/androidmanagement"
  4347. // ]
  4348. // }
  4349. }
  4350. // Pages invokes f for each page of results.
  4351. // A non-nil error returned from f will halt the iteration.
  4352. // The provided context supersedes any context provided to the Context method.
  4353. func (c *EnterprisesDevicesOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  4354. c.ctx_ = ctx
  4355. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4356. for {
  4357. x, err := c.Do()
  4358. if err != nil {
  4359. return err
  4360. }
  4361. if err := f(x); err != nil {
  4362. return err
  4363. }
  4364. if x.NextPageToken == "" {
  4365. return nil
  4366. }
  4367. c.PageToken(x.NextPageToken)
  4368. }
  4369. }
  4370. // method id "androidmanagement.enterprises.enrollmentTokens.create":
  4371. type EnterprisesEnrollmentTokensCreateCall struct {
  4372. s *Service
  4373. parent string
  4374. enrollmenttoken *EnrollmentToken
  4375. urlParams_ gensupport.URLParams
  4376. ctx_ context.Context
  4377. header_ http.Header
  4378. }
  4379. // Create: Creates an enrollment token for a given enterprise.
  4380. func (r *EnterprisesEnrollmentTokensService) Create(parent string, enrollmenttoken *EnrollmentToken) *EnterprisesEnrollmentTokensCreateCall {
  4381. c := &EnterprisesEnrollmentTokensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4382. c.parent = parent
  4383. c.enrollmenttoken = enrollmenttoken
  4384. return c
  4385. }
  4386. // Fields allows partial responses to be retrieved. See
  4387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4388. // for more information.
  4389. func (c *EnterprisesEnrollmentTokensCreateCall) Fields(s ...googleapi.Field) *EnterprisesEnrollmentTokensCreateCall {
  4390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4391. return c
  4392. }
  4393. // Context sets the context to be used in this call's Do method. Any
  4394. // pending HTTP request will be aborted if the provided context is
  4395. // canceled.
  4396. func (c *EnterprisesEnrollmentTokensCreateCall) Context(ctx context.Context) *EnterprisesEnrollmentTokensCreateCall {
  4397. c.ctx_ = ctx
  4398. return c
  4399. }
  4400. // Header returns an http.Header that can be modified by the caller to
  4401. // add HTTP headers to the request.
  4402. func (c *EnterprisesEnrollmentTokensCreateCall) Header() http.Header {
  4403. if c.header_ == nil {
  4404. c.header_ = make(http.Header)
  4405. }
  4406. return c.header_
  4407. }
  4408. func (c *EnterprisesEnrollmentTokensCreateCall) doRequest(alt string) (*http.Response, error) {
  4409. reqHeaders := make(http.Header)
  4410. for k, v := range c.header_ {
  4411. reqHeaders[k] = v
  4412. }
  4413. reqHeaders.Set("User-Agent", c.s.userAgent())
  4414. var body io.Reader = nil
  4415. body, err := googleapi.WithoutDataWrapper.JSONReader(c.enrollmenttoken)
  4416. if err != nil {
  4417. return nil, err
  4418. }
  4419. reqHeaders.Set("Content-Type", "application/json")
  4420. c.urlParams_.Set("alt", alt)
  4421. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/enrollmentTokens")
  4422. urls += "?" + c.urlParams_.Encode()
  4423. req, _ := http.NewRequest("POST", urls, body)
  4424. req.Header = reqHeaders
  4425. googleapi.Expand(req.URL, map[string]string{
  4426. "parent": c.parent,
  4427. })
  4428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4429. }
  4430. // Do executes the "androidmanagement.enterprises.enrollmentTokens.create" call.
  4431. // Exactly one of *EnrollmentToken or error will be non-nil. Any non-2xx
  4432. // status code is an error. Response headers are in either
  4433. // *EnrollmentToken.ServerResponse.Header or (if a response was returned
  4434. // at all) in error.(*googleapi.Error).Header. Use
  4435. // googleapi.IsNotModified to check whether the returned error was
  4436. // because http.StatusNotModified was returned.
  4437. func (c *EnterprisesEnrollmentTokensCreateCall) Do(opts ...googleapi.CallOption) (*EnrollmentToken, error) {
  4438. gensupport.SetOptions(c.urlParams_, opts...)
  4439. res, err := c.doRequest("json")
  4440. if res != nil && res.StatusCode == http.StatusNotModified {
  4441. if res.Body != nil {
  4442. res.Body.Close()
  4443. }
  4444. return nil, &googleapi.Error{
  4445. Code: res.StatusCode,
  4446. Header: res.Header,
  4447. }
  4448. }
  4449. if err != nil {
  4450. return nil, err
  4451. }
  4452. defer googleapi.CloseBody(res)
  4453. if err := googleapi.CheckResponse(res); err != nil {
  4454. return nil, err
  4455. }
  4456. ret := &EnrollmentToken{
  4457. ServerResponse: googleapi.ServerResponse{
  4458. Header: res.Header,
  4459. HTTPStatusCode: res.StatusCode,
  4460. },
  4461. }
  4462. target := &ret
  4463. if err := gensupport.DecodeResponse(target, res); err != nil {
  4464. return nil, err
  4465. }
  4466. return ret, nil
  4467. // {
  4468. // "description": "Creates an enrollment token for a given enterprise.",
  4469. // "flatPath": "v1/enterprises/{enterprisesId}/enrollmentTokens",
  4470. // "httpMethod": "POST",
  4471. // "id": "androidmanagement.enterprises.enrollmentTokens.create",
  4472. // "parameterOrder": [
  4473. // "parent"
  4474. // ],
  4475. // "parameters": {
  4476. // "parent": {
  4477. // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.",
  4478. // "location": "path",
  4479. // "pattern": "^enterprises/[^/]+$",
  4480. // "required": true,
  4481. // "type": "string"
  4482. // }
  4483. // },
  4484. // "path": "v1/{+parent}/enrollmentTokens",
  4485. // "request": {
  4486. // "$ref": "EnrollmentToken"
  4487. // },
  4488. // "response": {
  4489. // "$ref": "EnrollmentToken"
  4490. // },
  4491. // "scopes": [
  4492. // "https://www.googleapis.com/auth/androidmanagement"
  4493. // ]
  4494. // }
  4495. }
  4496. // method id "androidmanagement.enterprises.enrollmentTokens.delete":
  4497. type EnterprisesEnrollmentTokensDeleteCall struct {
  4498. s *Service
  4499. name string
  4500. urlParams_ gensupport.URLParams
  4501. ctx_ context.Context
  4502. header_ http.Header
  4503. }
  4504. // Delete: Deletes an enrollment token. This operation invalidates the
  4505. // token, preventing its future use.
  4506. func (r *EnterprisesEnrollmentTokensService) Delete(name string) *EnterprisesEnrollmentTokensDeleteCall {
  4507. c := &EnterprisesEnrollmentTokensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4508. c.name = name
  4509. return c
  4510. }
  4511. // Fields allows partial responses to be retrieved. See
  4512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4513. // for more information.
  4514. func (c *EnterprisesEnrollmentTokensDeleteCall) Fields(s ...googleapi.Field) *EnterprisesEnrollmentTokensDeleteCall {
  4515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4516. return c
  4517. }
  4518. // Context sets the context to be used in this call's Do method. Any
  4519. // pending HTTP request will be aborted if the provided context is
  4520. // canceled.
  4521. func (c *EnterprisesEnrollmentTokensDeleteCall) Context(ctx context.Context) *EnterprisesEnrollmentTokensDeleteCall {
  4522. c.ctx_ = ctx
  4523. return c
  4524. }
  4525. // Header returns an http.Header that can be modified by the caller to
  4526. // add HTTP headers to the request.
  4527. func (c *EnterprisesEnrollmentTokensDeleteCall) Header() http.Header {
  4528. if c.header_ == nil {
  4529. c.header_ = make(http.Header)
  4530. }
  4531. return c.header_
  4532. }
  4533. func (c *EnterprisesEnrollmentTokensDeleteCall) doRequest(alt string) (*http.Response, error) {
  4534. reqHeaders := make(http.Header)
  4535. for k, v := range c.header_ {
  4536. reqHeaders[k] = v
  4537. }
  4538. reqHeaders.Set("User-Agent", c.s.userAgent())
  4539. var body io.Reader = nil
  4540. c.urlParams_.Set("alt", alt)
  4541. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4542. urls += "?" + c.urlParams_.Encode()
  4543. req, _ := http.NewRequest("DELETE", urls, body)
  4544. req.Header = reqHeaders
  4545. googleapi.Expand(req.URL, map[string]string{
  4546. "name": c.name,
  4547. })
  4548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4549. }
  4550. // Do executes the "androidmanagement.enterprises.enrollmentTokens.delete" call.
  4551. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4552. // code is an error. Response headers are in either
  4553. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4554. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4555. // check whether the returned error was because http.StatusNotModified
  4556. // was returned.
  4557. func (c *EnterprisesEnrollmentTokensDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4558. gensupport.SetOptions(c.urlParams_, opts...)
  4559. res, err := c.doRequest("json")
  4560. if res != nil && res.StatusCode == http.StatusNotModified {
  4561. if res.Body != nil {
  4562. res.Body.Close()
  4563. }
  4564. return nil, &googleapi.Error{
  4565. Code: res.StatusCode,
  4566. Header: res.Header,
  4567. }
  4568. }
  4569. if err != nil {
  4570. return nil, err
  4571. }
  4572. defer googleapi.CloseBody(res)
  4573. if err := googleapi.CheckResponse(res); err != nil {
  4574. return nil, err
  4575. }
  4576. ret := &Empty{
  4577. ServerResponse: googleapi.ServerResponse{
  4578. Header: res.Header,
  4579. HTTPStatusCode: res.StatusCode,
  4580. },
  4581. }
  4582. target := &ret
  4583. if err := gensupport.DecodeResponse(target, res); err != nil {
  4584. return nil, err
  4585. }
  4586. return ret, nil
  4587. // {
  4588. // "description": "Deletes an enrollment token. This operation invalidates the token, preventing its future use.",
  4589. // "flatPath": "v1/enterprises/{enterprisesId}/enrollmentTokens/{enrollmentTokensId}",
  4590. // "httpMethod": "DELETE",
  4591. // "id": "androidmanagement.enterprises.enrollmentTokens.delete",
  4592. // "parameterOrder": [
  4593. // "name"
  4594. // ],
  4595. // "parameters": {
  4596. // "name": {
  4597. // "description": "The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}.",
  4598. // "location": "path",
  4599. // "pattern": "^enterprises/[^/]+/enrollmentTokens/[^/]+$",
  4600. // "required": true,
  4601. // "type": "string"
  4602. // }
  4603. // },
  4604. // "path": "v1/{+name}",
  4605. // "response": {
  4606. // "$ref": "Empty"
  4607. // },
  4608. // "scopes": [
  4609. // "https://www.googleapis.com/auth/androidmanagement"
  4610. // ]
  4611. // }
  4612. }
  4613. // method id "androidmanagement.enterprises.policies.delete":
  4614. type EnterprisesPoliciesDeleteCall struct {
  4615. s *Service
  4616. name string
  4617. urlParams_ gensupport.URLParams
  4618. ctx_ context.Context
  4619. header_ http.Header
  4620. }
  4621. // Delete: Deletes a policy. This operation is only permitted if no
  4622. // devices are currently referencing the policy.
  4623. func (r *EnterprisesPoliciesService) Delete(name string) *EnterprisesPoliciesDeleteCall {
  4624. c := &EnterprisesPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4625. c.name = name
  4626. return c
  4627. }
  4628. // Fields allows partial responses to be retrieved. See
  4629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4630. // for more information.
  4631. func (c *EnterprisesPoliciesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesDeleteCall {
  4632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4633. return c
  4634. }
  4635. // Context sets the context to be used in this call's Do method. Any
  4636. // pending HTTP request will be aborted if the provided context is
  4637. // canceled.
  4638. func (c *EnterprisesPoliciesDeleteCall) Context(ctx context.Context) *EnterprisesPoliciesDeleteCall {
  4639. c.ctx_ = ctx
  4640. return c
  4641. }
  4642. // Header returns an http.Header that can be modified by the caller to
  4643. // add HTTP headers to the request.
  4644. func (c *EnterprisesPoliciesDeleteCall) Header() http.Header {
  4645. if c.header_ == nil {
  4646. c.header_ = make(http.Header)
  4647. }
  4648. return c.header_
  4649. }
  4650. func (c *EnterprisesPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4651. reqHeaders := make(http.Header)
  4652. for k, v := range c.header_ {
  4653. reqHeaders[k] = v
  4654. }
  4655. reqHeaders.Set("User-Agent", c.s.userAgent())
  4656. var body io.Reader = nil
  4657. c.urlParams_.Set("alt", alt)
  4658. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4659. urls += "?" + c.urlParams_.Encode()
  4660. req, _ := http.NewRequest("DELETE", urls, body)
  4661. req.Header = reqHeaders
  4662. googleapi.Expand(req.URL, map[string]string{
  4663. "name": c.name,
  4664. })
  4665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4666. }
  4667. // Do executes the "androidmanagement.enterprises.policies.delete" call.
  4668. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4669. // code is an error. Response headers are in either
  4670. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4671. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4672. // check whether the returned error was because http.StatusNotModified
  4673. // was returned.
  4674. func (c *EnterprisesPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4675. gensupport.SetOptions(c.urlParams_, opts...)
  4676. res, err := c.doRequest("json")
  4677. if res != nil && res.StatusCode == http.StatusNotModified {
  4678. if res.Body != nil {
  4679. res.Body.Close()
  4680. }
  4681. return nil, &googleapi.Error{
  4682. Code: res.StatusCode,
  4683. Header: res.Header,
  4684. }
  4685. }
  4686. if err != nil {
  4687. return nil, err
  4688. }
  4689. defer googleapi.CloseBody(res)
  4690. if err := googleapi.CheckResponse(res); err != nil {
  4691. return nil, err
  4692. }
  4693. ret := &Empty{
  4694. ServerResponse: googleapi.ServerResponse{
  4695. Header: res.Header,
  4696. HTTPStatusCode: res.StatusCode,
  4697. },
  4698. }
  4699. target := &ret
  4700. if err := gensupport.DecodeResponse(target, res); err != nil {
  4701. return nil, err
  4702. }
  4703. return ret, nil
  4704. // {
  4705. // "description": "Deletes a policy. This operation is only permitted if no devices are currently referencing the policy.",
  4706. // "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}",
  4707. // "httpMethod": "DELETE",
  4708. // "id": "androidmanagement.enterprises.policies.delete",
  4709. // "parameterOrder": [
  4710. // "name"
  4711. // ],
  4712. // "parameters": {
  4713. // "name": {
  4714. // "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.",
  4715. // "location": "path",
  4716. // "pattern": "^enterprises/[^/]+/policies/[^/]+$",
  4717. // "required": true,
  4718. // "type": "string"
  4719. // }
  4720. // },
  4721. // "path": "v1/{+name}",
  4722. // "response": {
  4723. // "$ref": "Empty"
  4724. // },
  4725. // "scopes": [
  4726. // "https://www.googleapis.com/auth/androidmanagement"
  4727. // ]
  4728. // }
  4729. }
  4730. // method id "androidmanagement.enterprises.policies.get":
  4731. type EnterprisesPoliciesGetCall struct {
  4732. s *Service
  4733. name string
  4734. urlParams_ gensupport.URLParams
  4735. ifNoneMatch_ string
  4736. ctx_ context.Context
  4737. header_ http.Header
  4738. }
  4739. // Get: Gets a policy.
  4740. func (r *EnterprisesPoliciesService) Get(name string) *EnterprisesPoliciesGetCall {
  4741. c := &EnterprisesPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4742. c.name = name
  4743. return c
  4744. }
  4745. // Fields allows partial responses to be retrieved. See
  4746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4747. // for more information.
  4748. func (c *EnterprisesPoliciesGetCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesGetCall {
  4749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4750. return c
  4751. }
  4752. // IfNoneMatch sets the optional parameter which makes the operation
  4753. // fail if the object's ETag matches the given value. This is useful for
  4754. // getting updates only after the object has changed since the last
  4755. // request. Use googleapi.IsNotModified to check whether the response
  4756. // error from Do is the result of In-None-Match.
  4757. func (c *EnterprisesPoliciesGetCall) IfNoneMatch(entityTag string) *EnterprisesPoliciesGetCall {
  4758. c.ifNoneMatch_ = entityTag
  4759. return c
  4760. }
  4761. // Context sets the context to be used in this call's Do method. Any
  4762. // pending HTTP request will be aborted if the provided context is
  4763. // canceled.
  4764. func (c *EnterprisesPoliciesGetCall) Context(ctx context.Context) *EnterprisesPoliciesGetCall {
  4765. c.ctx_ = ctx
  4766. return c
  4767. }
  4768. // Header returns an http.Header that can be modified by the caller to
  4769. // add HTTP headers to the request.
  4770. func (c *EnterprisesPoliciesGetCall) Header() http.Header {
  4771. if c.header_ == nil {
  4772. c.header_ = make(http.Header)
  4773. }
  4774. return c.header_
  4775. }
  4776. func (c *EnterprisesPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  4777. reqHeaders := make(http.Header)
  4778. for k, v := range c.header_ {
  4779. reqHeaders[k] = v
  4780. }
  4781. reqHeaders.Set("User-Agent", c.s.userAgent())
  4782. if c.ifNoneMatch_ != "" {
  4783. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4784. }
  4785. var body io.Reader = nil
  4786. c.urlParams_.Set("alt", alt)
  4787. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4788. urls += "?" + c.urlParams_.Encode()
  4789. req, _ := http.NewRequest("GET", urls, body)
  4790. req.Header = reqHeaders
  4791. googleapi.Expand(req.URL, map[string]string{
  4792. "name": c.name,
  4793. })
  4794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4795. }
  4796. // Do executes the "androidmanagement.enterprises.policies.get" call.
  4797. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4798. // code is an error. Response headers are in either
  4799. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4800. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4801. // check whether the returned error was because http.StatusNotModified
  4802. // was returned.
  4803. func (c *EnterprisesPoliciesGetCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4804. gensupport.SetOptions(c.urlParams_, opts...)
  4805. res, err := c.doRequest("json")
  4806. if res != nil && res.StatusCode == http.StatusNotModified {
  4807. if res.Body != nil {
  4808. res.Body.Close()
  4809. }
  4810. return nil, &googleapi.Error{
  4811. Code: res.StatusCode,
  4812. Header: res.Header,
  4813. }
  4814. }
  4815. if err != nil {
  4816. return nil, err
  4817. }
  4818. defer googleapi.CloseBody(res)
  4819. if err := googleapi.CheckResponse(res); err != nil {
  4820. return nil, err
  4821. }
  4822. ret := &Policy{
  4823. ServerResponse: googleapi.ServerResponse{
  4824. Header: res.Header,
  4825. HTTPStatusCode: res.StatusCode,
  4826. },
  4827. }
  4828. target := &ret
  4829. if err := gensupport.DecodeResponse(target, res); err != nil {
  4830. return nil, err
  4831. }
  4832. return ret, nil
  4833. // {
  4834. // "description": "Gets a policy.",
  4835. // "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}",
  4836. // "httpMethod": "GET",
  4837. // "id": "androidmanagement.enterprises.policies.get",
  4838. // "parameterOrder": [
  4839. // "name"
  4840. // ],
  4841. // "parameters": {
  4842. // "name": {
  4843. // "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.",
  4844. // "location": "path",
  4845. // "pattern": "^enterprises/[^/]+/policies/[^/]+$",
  4846. // "required": true,
  4847. // "type": "string"
  4848. // }
  4849. // },
  4850. // "path": "v1/{+name}",
  4851. // "response": {
  4852. // "$ref": "Policy"
  4853. // },
  4854. // "scopes": [
  4855. // "https://www.googleapis.com/auth/androidmanagement"
  4856. // ]
  4857. // }
  4858. }
  4859. // method id "androidmanagement.enterprises.policies.list":
  4860. type EnterprisesPoliciesListCall struct {
  4861. s *Service
  4862. parent string
  4863. urlParams_ gensupport.URLParams
  4864. ifNoneMatch_ string
  4865. ctx_ context.Context
  4866. header_ http.Header
  4867. }
  4868. // List: Lists policies for a given enterprise.
  4869. func (r *EnterprisesPoliciesService) List(parent string) *EnterprisesPoliciesListCall {
  4870. c := &EnterprisesPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4871. c.parent = parent
  4872. return c
  4873. }
  4874. // PageSize sets the optional parameter "pageSize": The requested page
  4875. // size. The actual page size may be fixed to a min or max value.
  4876. func (c *EnterprisesPoliciesListCall) PageSize(pageSize int64) *EnterprisesPoliciesListCall {
  4877. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4878. return c
  4879. }
  4880. // PageToken sets the optional parameter "pageToken": A token
  4881. // identifying a page of results returned by the server.
  4882. func (c *EnterprisesPoliciesListCall) PageToken(pageToken string) *EnterprisesPoliciesListCall {
  4883. c.urlParams_.Set("pageToken", pageToken)
  4884. return c
  4885. }
  4886. // Fields allows partial responses to be retrieved. See
  4887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4888. // for more information.
  4889. func (c *EnterprisesPoliciesListCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesListCall {
  4890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4891. return c
  4892. }
  4893. // IfNoneMatch sets the optional parameter which makes the operation
  4894. // fail if the object's ETag matches the given value. This is useful for
  4895. // getting updates only after the object has changed since the last
  4896. // request. Use googleapi.IsNotModified to check whether the response
  4897. // error from Do is the result of In-None-Match.
  4898. func (c *EnterprisesPoliciesListCall) IfNoneMatch(entityTag string) *EnterprisesPoliciesListCall {
  4899. c.ifNoneMatch_ = entityTag
  4900. return c
  4901. }
  4902. // Context sets the context to be used in this call's Do method. Any
  4903. // pending HTTP request will be aborted if the provided context is
  4904. // canceled.
  4905. func (c *EnterprisesPoliciesListCall) Context(ctx context.Context) *EnterprisesPoliciesListCall {
  4906. c.ctx_ = ctx
  4907. return c
  4908. }
  4909. // Header returns an http.Header that can be modified by the caller to
  4910. // add HTTP headers to the request.
  4911. func (c *EnterprisesPoliciesListCall) Header() http.Header {
  4912. if c.header_ == nil {
  4913. c.header_ = make(http.Header)
  4914. }
  4915. return c.header_
  4916. }
  4917. func (c *EnterprisesPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  4918. reqHeaders := make(http.Header)
  4919. for k, v := range c.header_ {
  4920. reqHeaders[k] = v
  4921. }
  4922. reqHeaders.Set("User-Agent", c.s.userAgent())
  4923. if c.ifNoneMatch_ != "" {
  4924. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4925. }
  4926. var body io.Reader = nil
  4927. c.urlParams_.Set("alt", alt)
  4928. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/policies")
  4929. urls += "?" + c.urlParams_.Encode()
  4930. req, _ := http.NewRequest("GET", urls, body)
  4931. req.Header = reqHeaders
  4932. googleapi.Expand(req.URL, map[string]string{
  4933. "parent": c.parent,
  4934. })
  4935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4936. }
  4937. // Do executes the "androidmanagement.enterprises.policies.list" call.
  4938. // Exactly one of *ListPoliciesResponse or error will be non-nil. Any
  4939. // non-2xx status code is an error. Response headers are in either
  4940. // *ListPoliciesResponse.ServerResponse.Header or (if a response was
  4941. // returned at all) in error.(*googleapi.Error).Header. Use
  4942. // googleapi.IsNotModified to check whether the returned error was
  4943. // because http.StatusNotModified was returned.
  4944. func (c *EnterprisesPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListPoliciesResponse, error) {
  4945. gensupport.SetOptions(c.urlParams_, opts...)
  4946. res, err := c.doRequest("json")
  4947. if res != nil && res.StatusCode == http.StatusNotModified {
  4948. if res.Body != nil {
  4949. res.Body.Close()
  4950. }
  4951. return nil, &googleapi.Error{
  4952. Code: res.StatusCode,
  4953. Header: res.Header,
  4954. }
  4955. }
  4956. if err != nil {
  4957. return nil, err
  4958. }
  4959. defer googleapi.CloseBody(res)
  4960. if err := googleapi.CheckResponse(res); err != nil {
  4961. return nil, err
  4962. }
  4963. ret := &ListPoliciesResponse{
  4964. ServerResponse: googleapi.ServerResponse{
  4965. Header: res.Header,
  4966. HTTPStatusCode: res.StatusCode,
  4967. },
  4968. }
  4969. target := &ret
  4970. if err := gensupport.DecodeResponse(target, res); err != nil {
  4971. return nil, err
  4972. }
  4973. return ret, nil
  4974. // {
  4975. // "description": "Lists policies for a given enterprise.",
  4976. // "flatPath": "v1/enterprises/{enterprisesId}/policies",
  4977. // "httpMethod": "GET",
  4978. // "id": "androidmanagement.enterprises.policies.list",
  4979. // "parameterOrder": [
  4980. // "parent"
  4981. // ],
  4982. // "parameters": {
  4983. // "pageSize": {
  4984. // "description": "The requested page size. The actual page size may be fixed to a min or max value.",
  4985. // "format": "int32",
  4986. // "location": "query",
  4987. // "type": "integer"
  4988. // },
  4989. // "pageToken": {
  4990. // "description": "A token identifying a page of results returned by the server.",
  4991. // "location": "query",
  4992. // "type": "string"
  4993. // },
  4994. // "parent": {
  4995. // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.",
  4996. // "location": "path",
  4997. // "pattern": "^enterprises/[^/]+$",
  4998. // "required": true,
  4999. // "type": "string"
  5000. // }
  5001. // },
  5002. // "path": "v1/{+parent}/policies",
  5003. // "response": {
  5004. // "$ref": "ListPoliciesResponse"
  5005. // },
  5006. // "scopes": [
  5007. // "https://www.googleapis.com/auth/androidmanagement"
  5008. // ]
  5009. // }
  5010. }
  5011. // Pages invokes f for each page of results.
  5012. // A non-nil error returned from f will halt the iteration.
  5013. // The provided context supersedes any context provided to the Context method.
  5014. func (c *EnterprisesPoliciesListCall) Pages(ctx context.Context, f func(*ListPoliciesResponse) error) error {
  5015. c.ctx_ = ctx
  5016. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5017. for {
  5018. x, err := c.Do()
  5019. if err != nil {
  5020. return err
  5021. }
  5022. if err := f(x); err != nil {
  5023. return err
  5024. }
  5025. if x.NextPageToken == "" {
  5026. return nil
  5027. }
  5028. c.PageToken(x.NextPageToken)
  5029. }
  5030. }
  5031. // method id "androidmanagement.enterprises.policies.patch":
  5032. type EnterprisesPoliciesPatchCall struct {
  5033. s *Service
  5034. name string
  5035. policy *Policy
  5036. urlParams_ gensupport.URLParams
  5037. ctx_ context.Context
  5038. header_ http.Header
  5039. }
  5040. // Patch: Updates or creates a policy.
  5041. func (r *EnterprisesPoliciesService) Patch(name string, policy *Policy) *EnterprisesPoliciesPatchCall {
  5042. c := &EnterprisesPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5043. c.name = name
  5044. c.policy = policy
  5045. return c
  5046. }
  5047. // UpdateMask sets the optional parameter "updateMask": The field mask
  5048. // indicating the fields to update. If not set, all modifiable fields
  5049. // will be modified.
  5050. func (c *EnterprisesPoliciesPatchCall) UpdateMask(updateMask string) *EnterprisesPoliciesPatchCall {
  5051. c.urlParams_.Set("updateMask", updateMask)
  5052. return c
  5053. }
  5054. // Fields allows partial responses to be retrieved. See
  5055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5056. // for more information.
  5057. func (c *EnterprisesPoliciesPatchCall) Fields(s ...googleapi.Field) *EnterprisesPoliciesPatchCall {
  5058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5059. return c
  5060. }
  5061. // Context sets the context to be used in this call's Do method. Any
  5062. // pending HTTP request will be aborted if the provided context is
  5063. // canceled.
  5064. func (c *EnterprisesPoliciesPatchCall) Context(ctx context.Context) *EnterprisesPoliciesPatchCall {
  5065. c.ctx_ = ctx
  5066. return c
  5067. }
  5068. // Header returns an http.Header that can be modified by the caller to
  5069. // add HTTP headers to the request.
  5070. func (c *EnterprisesPoliciesPatchCall) Header() http.Header {
  5071. if c.header_ == nil {
  5072. c.header_ = make(http.Header)
  5073. }
  5074. return c.header_
  5075. }
  5076. func (c *EnterprisesPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  5077. reqHeaders := make(http.Header)
  5078. for k, v := range c.header_ {
  5079. reqHeaders[k] = v
  5080. }
  5081. reqHeaders.Set("User-Agent", c.s.userAgent())
  5082. var body io.Reader = nil
  5083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
  5084. if err != nil {
  5085. return nil, err
  5086. }
  5087. reqHeaders.Set("Content-Type", "application/json")
  5088. c.urlParams_.Set("alt", alt)
  5089. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5090. urls += "?" + c.urlParams_.Encode()
  5091. req, _ := http.NewRequest("PATCH", urls, body)
  5092. req.Header = reqHeaders
  5093. googleapi.Expand(req.URL, map[string]string{
  5094. "name": c.name,
  5095. })
  5096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5097. }
  5098. // Do executes the "androidmanagement.enterprises.policies.patch" call.
  5099. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  5100. // code is an error. Response headers are in either
  5101. // *Policy.ServerResponse.Header or (if a response was returned at all)
  5102. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5103. // check whether the returned error was because http.StatusNotModified
  5104. // was returned.
  5105. func (c *EnterprisesPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5106. gensupport.SetOptions(c.urlParams_, opts...)
  5107. res, err := c.doRequest("json")
  5108. if res != nil && res.StatusCode == http.StatusNotModified {
  5109. if res.Body != nil {
  5110. res.Body.Close()
  5111. }
  5112. return nil, &googleapi.Error{
  5113. Code: res.StatusCode,
  5114. Header: res.Header,
  5115. }
  5116. }
  5117. if err != nil {
  5118. return nil, err
  5119. }
  5120. defer googleapi.CloseBody(res)
  5121. if err := googleapi.CheckResponse(res); err != nil {
  5122. return nil, err
  5123. }
  5124. ret := &Policy{
  5125. ServerResponse: googleapi.ServerResponse{
  5126. Header: res.Header,
  5127. HTTPStatusCode: res.StatusCode,
  5128. },
  5129. }
  5130. target := &ret
  5131. if err := gensupport.DecodeResponse(target, res); err != nil {
  5132. return nil, err
  5133. }
  5134. return ret, nil
  5135. // {
  5136. // "description": "Updates or creates a policy.",
  5137. // "flatPath": "v1/enterprises/{enterprisesId}/policies/{policiesId}",
  5138. // "httpMethod": "PATCH",
  5139. // "id": "androidmanagement.enterprises.policies.patch",
  5140. // "parameterOrder": [
  5141. // "name"
  5142. // ],
  5143. // "parameters": {
  5144. // "name": {
  5145. // "description": "The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}.",
  5146. // "location": "path",
  5147. // "pattern": "^enterprises/[^/]+/policies/[^/]+$",
  5148. // "required": true,
  5149. // "type": "string"
  5150. // },
  5151. // "updateMask": {
  5152. // "description": "The field mask indicating the fields to update. If not set, all modifiable fields will be modified.",
  5153. // "format": "google-fieldmask",
  5154. // "location": "query",
  5155. // "type": "string"
  5156. // }
  5157. // },
  5158. // "path": "v1/{+name}",
  5159. // "request": {
  5160. // "$ref": "Policy"
  5161. // },
  5162. // "response": {
  5163. // "$ref": "Policy"
  5164. // },
  5165. // "scopes": [
  5166. // "https://www.googleapis.com/auth/androidmanagement"
  5167. // ]
  5168. // }
  5169. }
  5170. // method id "androidmanagement.enterprises.webTokens.create":
  5171. type EnterprisesWebTokensCreateCall struct {
  5172. s *Service
  5173. parent string
  5174. webtoken *WebToken
  5175. urlParams_ gensupport.URLParams
  5176. ctx_ context.Context
  5177. header_ http.Header
  5178. }
  5179. // Create: Creates a web token to access an embeddable managed Google
  5180. // Play web UI for a given enterprise.
  5181. func (r *EnterprisesWebTokensService) Create(parent string, webtoken *WebToken) *EnterprisesWebTokensCreateCall {
  5182. c := &EnterprisesWebTokensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5183. c.parent = parent
  5184. c.webtoken = webtoken
  5185. return c
  5186. }
  5187. // Fields allows partial responses to be retrieved. See
  5188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5189. // for more information.
  5190. func (c *EnterprisesWebTokensCreateCall) Fields(s ...googleapi.Field) *EnterprisesWebTokensCreateCall {
  5191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5192. return c
  5193. }
  5194. // Context sets the context to be used in this call's Do method. Any
  5195. // pending HTTP request will be aborted if the provided context is
  5196. // canceled.
  5197. func (c *EnterprisesWebTokensCreateCall) Context(ctx context.Context) *EnterprisesWebTokensCreateCall {
  5198. c.ctx_ = ctx
  5199. return c
  5200. }
  5201. // Header returns an http.Header that can be modified by the caller to
  5202. // add HTTP headers to the request.
  5203. func (c *EnterprisesWebTokensCreateCall) Header() http.Header {
  5204. if c.header_ == nil {
  5205. c.header_ = make(http.Header)
  5206. }
  5207. return c.header_
  5208. }
  5209. func (c *EnterprisesWebTokensCreateCall) doRequest(alt string) (*http.Response, error) {
  5210. reqHeaders := make(http.Header)
  5211. for k, v := range c.header_ {
  5212. reqHeaders[k] = v
  5213. }
  5214. reqHeaders.Set("User-Agent", c.s.userAgent())
  5215. var body io.Reader = nil
  5216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webtoken)
  5217. if err != nil {
  5218. return nil, err
  5219. }
  5220. reqHeaders.Set("Content-Type", "application/json")
  5221. c.urlParams_.Set("alt", alt)
  5222. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/webTokens")
  5223. urls += "?" + c.urlParams_.Encode()
  5224. req, _ := http.NewRequest("POST", urls, body)
  5225. req.Header = reqHeaders
  5226. googleapi.Expand(req.URL, map[string]string{
  5227. "parent": c.parent,
  5228. })
  5229. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5230. }
  5231. // Do executes the "androidmanagement.enterprises.webTokens.create" call.
  5232. // Exactly one of *WebToken or error will be non-nil. Any non-2xx status
  5233. // code is an error. Response headers are in either
  5234. // *WebToken.ServerResponse.Header or (if a response was returned at
  5235. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5236. // to check whether the returned error was because
  5237. // http.StatusNotModified was returned.
  5238. func (c *EnterprisesWebTokensCreateCall) Do(opts ...googleapi.CallOption) (*WebToken, error) {
  5239. gensupport.SetOptions(c.urlParams_, opts...)
  5240. res, err := c.doRequest("json")
  5241. if res != nil && res.StatusCode == http.StatusNotModified {
  5242. if res.Body != nil {
  5243. res.Body.Close()
  5244. }
  5245. return nil, &googleapi.Error{
  5246. Code: res.StatusCode,
  5247. Header: res.Header,
  5248. }
  5249. }
  5250. if err != nil {
  5251. return nil, err
  5252. }
  5253. defer googleapi.CloseBody(res)
  5254. if err := googleapi.CheckResponse(res); err != nil {
  5255. return nil, err
  5256. }
  5257. ret := &WebToken{
  5258. ServerResponse: googleapi.ServerResponse{
  5259. Header: res.Header,
  5260. HTTPStatusCode: res.StatusCode,
  5261. },
  5262. }
  5263. target := &ret
  5264. if err := gensupport.DecodeResponse(target, res); err != nil {
  5265. return nil, err
  5266. }
  5267. return ret, nil
  5268. // {
  5269. // "description": "Creates a web token to access an embeddable managed Google Play web UI for a given enterprise.",
  5270. // "flatPath": "v1/enterprises/{enterprisesId}/webTokens",
  5271. // "httpMethod": "POST",
  5272. // "id": "androidmanagement.enterprises.webTokens.create",
  5273. // "parameterOrder": [
  5274. // "parent"
  5275. // ],
  5276. // "parameters": {
  5277. // "parent": {
  5278. // "description": "The name of the enterprise in the form enterprises/{enterpriseId}.",
  5279. // "location": "path",
  5280. // "pattern": "^enterprises/[^/]+$",
  5281. // "required": true,
  5282. // "type": "string"
  5283. // }
  5284. // },
  5285. // "path": "v1/{+parent}/webTokens",
  5286. // "request": {
  5287. // "$ref": "WebToken"
  5288. // },
  5289. // "response": {
  5290. // "$ref": "WebToken"
  5291. // },
  5292. // "scopes": [
  5293. // "https://www.googleapis.com/auth/androidmanagement"
  5294. // ]
  5295. // }
  5296. }
  5297. // method id "androidmanagement.signupUrls.create":
  5298. type SignupUrlsCreateCall struct {
  5299. s *Service
  5300. urlParams_ gensupport.URLParams
  5301. ctx_ context.Context
  5302. header_ http.Header
  5303. }
  5304. // Create: Creates an enterprise signup URL.
  5305. func (r *SignupUrlsService) Create() *SignupUrlsCreateCall {
  5306. c := &SignupUrlsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5307. return c
  5308. }
  5309. // CallbackUrl sets the optional parameter "callbackUrl": The callback
  5310. // URL that the admin will be redirected to after successfully creating
  5311. // an enterprise. Before redirecting there the system will add a query
  5312. // parameter to this URL named enterpriseToken which will contain an
  5313. // opaque token to be used for the create enterprise request. The URL
  5314. // will be parsed then reformatted in order to add the enterpriseToken
  5315. // parameter, so there may be some minor formatting changes.
  5316. func (c *SignupUrlsCreateCall) CallbackUrl(callbackUrl string) *SignupUrlsCreateCall {
  5317. c.urlParams_.Set("callbackUrl", callbackUrl)
  5318. return c
  5319. }
  5320. // ProjectId sets the optional parameter "projectId": The ID of the
  5321. // Google Cloud Platform project which will own the enterprise.
  5322. func (c *SignupUrlsCreateCall) ProjectId(projectId string) *SignupUrlsCreateCall {
  5323. c.urlParams_.Set("projectId", projectId)
  5324. return c
  5325. }
  5326. // Fields allows partial responses to be retrieved. See
  5327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5328. // for more information.
  5329. func (c *SignupUrlsCreateCall) Fields(s ...googleapi.Field) *SignupUrlsCreateCall {
  5330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5331. return c
  5332. }
  5333. // Context sets the context to be used in this call's Do method. Any
  5334. // pending HTTP request will be aborted if the provided context is
  5335. // canceled.
  5336. func (c *SignupUrlsCreateCall) Context(ctx context.Context) *SignupUrlsCreateCall {
  5337. c.ctx_ = ctx
  5338. return c
  5339. }
  5340. // Header returns an http.Header that can be modified by the caller to
  5341. // add HTTP headers to the request.
  5342. func (c *SignupUrlsCreateCall) Header() http.Header {
  5343. if c.header_ == nil {
  5344. c.header_ = make(http.Header)
  5345. }
  5346. return c.header_
  5347. }
  5348. func (c *SignupUrlsCreateCall) doRequest(alt string) (*http.Response, error) {
  5349. reqHeaders := make(http.Header)
  5350. for k, v := range c.header_ {
  5351. reqHeaders[k] = v
  5352. }
  5353. reqHeaders.Set("User-Agent", c.s.userAgent())
  5354. var body io.Reader = nil
  5355. c.urlParams_.Set("alt", alt)
  5356. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/signupUrls")
  5357. urls += "?" + c.urlParams_.Encode()
  5358. req, _ := http.NewRequest("POST", urls, body)
  5359. req.Header = reqHeaders
  5360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5361. }
  5362. // Do executes the "androidmanagement.signupUrls.create" call.
  5363. // Exactly one of *SignupUrl or error will be non-nil. Any non-2xx
  5364. // status code is an error. Response headers are in either
  5365. // *SignupUrl.ServerResponse.Header or (if a response was returned at
  5366. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5367. // to check whether the returned error was because
  5368. // http.StatusNotModified was returned.
  5369. func (c *SignupUrlsCreateCall) Do(opts ...googleapi.CallOption) (*SignupUrl, error) {
  5370. gensupport.SetOptions(c.urlParams_, opts...)
  5371. res, err := c.doRequest("json")
  5372. if res != nil && res.StatusCode == http.StatusNotModified {
  5373. if res.Body != nil {
  5374. res.Body.Close()
  5375. }
  5376. return nil, &googleapi.Error{
  5377. Code: res.StatusCode,
  5378. Header: res.Header,
  5379. }
  5380. }
  5381. if err != nil {
  5382. return nil, err
  5383. }
  5384. defer googleapi.CloseBody(res)
  5385. if err := googleapi.CheckResponse(res); err != nil {
  5386. return nil, err
  5387. }
  5388. ret := &SignupUrl{
  5389. ServerResponse: googleapi.ServerResponse{
  5390. Header: res.Header,
  5391. HTTPStatusCode: res.StatusCode,
  5392. },
  5393. }
  5394. target := &ret
  5395. if err := gensupport.DecodeResponse(target, res); err != nil {
  5396. return nil, err
  5397. }
  5398. return ret, nil
  5399. // {
  5400. // "description": "Creates an enterprise signup URL.",
  5401. // "flatPath": "v1/signupUrls",
  5402. // "httpMethod": "POST",
  5403. // "id": "androidmanagement.signupUrls.create",
  5404. // "parameterOrder": [],
  5405. // "parameters": {
  5406. // "callbackUrl": {
  5407. // "description": "The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes.",
  5408. // "location": "query",
  5409. // "type": "string"
  5410. // },
  5411. // "projectId": {
  5412. // "description": "The ID of the Google Cloud Platform project which will own the enterprise.",
  5413. // "location": "query",
  5414. // "type": "string"
  5415. // }
  5416. // },
  5417. // "path": "v1/signupUrls",
  5418. // "response": {
  5419. // "$ref": "SignupUrl"
  5420. // },
  5421. // "scopes": [
  5422. // "https://www.googleapis.com/auth/androidmanagement"
  5423. // ]
  5424. // }
  5425. }