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

6527 rivejä
247 KiB

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