blob: e8906139249052c9b63d2d577e50119e7529da83 [file] [log] [blame]
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Nathaniel Manista4f877e52015-06-15 16:44:50 +000075<h1><a href="androidenterprise_v1.html">Google Play EMM API</a> . <a href="androidenterprise_v1.devices.html">devices</a></h1>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +000076<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#forceReportUpload">forceReportUpload(enterpriseId, userId, deviceId)</a></code></p>
79<p class="firstline">Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device.</p>
80<p class="toc_element">
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +000081 <code><a href="#get">get(enterpriseId, userId, deviceId)</a></code></p>
82<p class="firstline">Retrieves the details of a device.</p>
83<p class="toc_element">
84 <code><a href="#getState">getState(enterpriseId, userId, deviceId)</a></code></p>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070085<p class="firstline">Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.</p>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +000086<p class="toc_element">
87 <code><a href="#list">list(enterpriseId, userId)</a></code></p>
88<p class="firstline">Retrieves the IDs of all of a user's devices.</p>
89<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#setState">setState(enterpriseId, userId, deviceId, body=None)</a></code></p>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070091<p class="firstline">Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070092<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#update">update(enterpriseId, userId, deviceId, body=None, updateMask=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Updates the device policy</p>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +000095<h3>Method Details</h3>
96<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097 <code class="details" id="forceReportUpload">forceReportUpload(enterpriseId, userId, deviceId)</code>
98 <pre>Uploads a report containing any changes in app states on the device since the last report was generated. You can call this method up to 3 times every 24 hours for a given device.
99
100Args:
101 enterpriseId: string, The ID of the enterprise. (required)
102 userId: string, The ID of the user. (required)
103 deviceId: string, The ID of the device. (required)
104</pre>
105</div>
106
107<div class="method">
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000108 <code class="details" id="get">get(enterpriseId, userId, deviceId)</code>
109 <pre>Retrieves the details of a device.
110
111Args:
112 enterpriseId: string, The ID of the enterprise. (required)
113 userId: string, The ID of the user. (required)
114 deviceId: string, The ID of the device. (required)
115
116Returns:
117 An object of the form:
118
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400119 { # A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120 "policy": { # The device policy for a given managed device. # The policy enforced on the device.
121 "autoUpdatePolicy": "A String", # The auto-update policy for apps installed on the device. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi.
122 "maintenanceWindow": { # Maintenance window for managed Google Play Accounts. This allows Play store to update the apps on the foreground in the designated window. # The maintenance window defining when apps running in the foreground should be updated.
123 "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
124 "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
125 },
126 "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
Dan O'Mearadd494642020-05-01 07:42:23 -0700127 "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700128 { # The policy for a product.
129 "autoInstallPolicy": { # The auto-install policy for the product.
130 "autoInstallMode": "A String", # The auto-install mode. If unset defaults to "doNotAutoInstall".
131 "autoInstallConstraint": [ # The constraints for auto-installing the app. You can specify a maximum of one constraint.
132 { # The auto-install constraint. Defines a set of restrictions for installation. At least one of the fields must be set.
133 "chargingStateConstraint": "A String", # Charging state constraint.
134 "deviceIdleStateConstraint": "A String", # Device idle state constraint.
135 "networkTypeConstraint": "A String", # Network type constraint.
136 },
137 ],
138 "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 "minimumVersionCode": 42, # The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 },
141 "tracks": [ # Deprecated. Use trackIds instead.
142 "A String",
143 ],
144 "managedConfiguration": { # A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user. # The managed configuration for the product.
Dan O'Mearadd494642020-05-01 07:42:23 -0700145 "kind": "A String", # Deprecated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700146 "configurationVariables": { # A configuration variables resource contains the managed configuration settings ID to be applied to a single user, as well as the variable set that is attributed to the user. The variable set will be used to replace placeholders in the managed configuration settings. # Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 "kind": "androidenterprise#configurationVariables",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 "variableSet": [ # The variable set that is attributed to the user.
149 { # A variable set is a key-value pair of EMM-provided placeholders and its corresponding value, which is attributed to a user. For example, $FIRSTNAME could be a placeholder, and its value could be Alice. Placeholders should start with a '$' sign and should be alphanumeric only.
150 "userValue": "A String", # The value of the placeholder, specific to the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700151 "kind": "androidenterprise#variableSet",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700152 "placeholder": "A String", # The placeholder string; defined by EMM.
153 },
154 ],
155 "mcmId": "A String", # The ID of the managed configurations settings.
156 },
157 "managedProperty": [ # The set of managed properties for this configuration.
158 { # A managed property of a managed configuration. The property must match one of the properties in the app restrictions schema of the product. Exactly one of the value fields must be populated, and it must match the property's type in the app restrictions schema.
159 "key": "A String", # The unique key that identifies the property.
160 "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
161 "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
162 "A String",
163 ],
164 "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
165 "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
166 { # A bundle of managed properties.
167 "managedProperty": [ # The list of managed properties.
168 # Object with schema name: ManagedProperty
169 ],
170 },
171 ],
172 "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
173 "managedProperty": [ # The list of managed properties.
174 # Object with schema name: ManagedProperty
175 ],
176 },
177 "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
178 },
179 ],
180 "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
181 },
182 "trackIds": [ # Grants the device visibility to the specified product release track(s), identified by trackIds. The list of release tracks of a product can be obtained by calling Products.Get.
183 "A String",
184 ],
185 "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
186 },
187 ],
188 "productAvailabilityPolicy": "A String", # The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default.
189 },
190 "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
191 "appState": [ # List of app states set by managed apps on the device. App states are defined by the app's developers. This field will always be present.
192 { # List of states set by the app.
193 "packageName": "A String", # The package name of the app. This field will always be present.
194 "keyedAppState": [ # List of keyed app states. This field will always be present.
195 { # Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data.
196 "message": "A String", # Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
197 "data": "A String", # Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
198 "severity": "A String", # Severity of the app state. This field will always be present.
199 "key": "A String", # Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
200 "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
201 },
202 ],
203 },
204 ],
205 "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
206 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700207 "kind": "androidenterprise#device",
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400208 "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700209 #
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700210 # Possible values include:
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400211 # - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
212 # - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
213 # - "containerApp", no longer used (deprecated).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400214 # - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.
215 "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000216 }</pre>
217</div>
218
219<div class="method">
220 <code class="details" id="getState">getState(enterpriseId, userId, deviceId)</code>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700221 <pre>Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000222
223Args:
224 enterpriseId: string, The ID of the enterprise. (required)
225 userId: string, The ID of the user. (required)
226 deviceId: string, The ID of the device. (required)
227
228Returns:
229 An object of the form:
230
231 { # The state of a user's device, as accessed by the getState and setState methods on device resources.
Dan O'Mearadd494642020-05-01 07:42:23 -0700232 "kind": "androidenterprise#deviceState",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700233 "accountState": "A String", # The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state.
234 }</pre>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000235</div>
236
237<div class="method">
238 <code class="details" id="list">list(enterpriseId, userId)</code>
239 <pre>Retrieves the IDs of all of a user's devices.
240
241Args:
242 enterpriseId: string, The ID of the enterprise. (required)
243 userId: string, The ID of the user. (required)
244
245Returns:
246 An object of the form:
247
248 { # The device resources for the user.
249 "device": [ # A managed device.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400250 { # A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700251 "policy": { # The device policy for a given managed device. # The policy enforced on the device.
252 "autoUpdatePolicy": "A String", # The auto-update policy for apps installed on the device. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi.
253 "maintenanceWindow": { # Maintenance window for managed Google Play Accounts. This allows Play store to update the apps on the foreground in the designated window. # The maintenance window defining when apps running in the foreground should be updated.
254 "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
255 "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
256 },
257 "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
Dan O'Mearadd494642020-05-01 07:42:23 -0700258 "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 { # The policy for a product.
260 "autoInstallPolicy": { # The auto-install policy for the product.
261 "autoInstallMode": "A String", # The auto-install mode. If unset defaults to "doNotAutoInstall".
262 "autoInstallConstraint": [ # The constraints for auto-installing the app. You can specify a maximum of one constraint.
263 { # The auto-install constraint. Defines a set of restrictions for installation. At least one of the fields must be set.
264 "chargingStateConstraint": "A String", # Charging state constraint.
265 "deviceIdleStateConstraint": "A String", # Device idle state constraint.
266 "networkTypeConstraint": "A String", # Network type constraint.
267 },
268 ],
269 "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
Dan O'Mearadd494642020-05-01 07:42:23 -0700270 "minimumVersionCode": 42, # The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700271 },
272 "tracks": [ # Deprecated. Use trackIds instead.
273 "A String",
274 ],
275 "managedConfiguration": { # A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user. # The managed configuration for the product.
Dan O'Mearadd494642020-05-01 07:42:23 -0700276 "kind": "A String", # Deprecated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700277 "configurationVariables": { # A configuration variables resource contains the managed configuration settings ID to be applied to a single user, as well as the variable set that is attributed to the user. The variable set will be used to replace placeholders in the managed configuration settings. # Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700278 "kind": "androidenterprise#configurationVariables",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 "variableSet": [ # The variable set that is attributed to the user.
280 { # A variable set is a key-value pair of EMM-provided placeholders and its corresponding value, which is attributed to a user. For example, $FIRSTNAME could be a placeholder, and its value could be Alice. Placeholders should start with a '$' sign and should be alphanumeric only.
281 "userValue": "A String", # The value of the placeholder, specific to the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700282 "kind": "androidenterprise#variableSet",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700283 "placeholder": "A String", # The placeholder string; defined by EMM.
284 },
285 ],
286 "mcmId": "A String", # The ID of the managed configurations settings.
287 },
288 "managedProperty": [ # The set of managed properties for this configuration.
289 { # A managed property of a managed configuration. The property must match one of the properties in the app restrictions schema of the product. Exactly one of the value fields must be populated, and it must match the property's type in the app restrictions schema.
290 "key": "A String", # The unique key that identifies the property.
291 "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
292 "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
293 "A String",
294 ],
295 "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
296 "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
297 { # A bundle of managed properties.
298 "managedProperty": [ # The list of managed properties.
299 # Object with schema name: ManagedProperty
300 ],
301 },
302 ],
303 "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
304 "managedProperty": [ # The list of managed properties.
305 # Object with schema name: ManagedProperty
306 ],
307 },
308 "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
309 },
310 ],
311 "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
312 },
313 "trackIds": [ # Grants the device visibility to the specified product release track(s), identified by trackIds. The list of release tracks of a product can be obtained by calling Products.Get.
314 "A String",
315 ],
316 "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
317 },
318 ],
319 "productAvailabilityPolicy": "A String", # The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default.
320 },
321 "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
322 "appState": [ # List of app states set by managed apps on the device. App states are defined by the app's developers. This field will always be present.
323 { # List of states set by the app.
324 "packageName": "A String", # The package name of the app. This field will always be present.
325 "keyedAppState": [ # List of keyed app states. This field will always be present.
326 { # Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data.
327 "message": "A String", # Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
328 "data": "A String", # Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
329 "severity": "A String", # Severity of the app state. This field will always be present.
330 "key": "A String", # Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
331 "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
332 },
333 ],
334 },
335 ],
336 "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
337 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700338 "kind": "androidenterprise#device",
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400339 "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700340 #
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700341 # Possible values include:
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400342 # - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
343 # - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
344 # - "containerApp", no longer used (deprecated).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400345 # - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.
346 "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000347 },
348 ],
349 "kind": "androidenterprise#devicesListResponse", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#devicesListResponse".
350 }</pre>
351</div>
352
353<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700354 <code class="details" id="setState">setState(enterpriseId, userId, deviceId, body=None)</code>
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700355 <pre>Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000356
357Args:
358 enterpriseId: string, The ID of the enterprise. (required)
359 userId: string, The ID of the user. (required)
360 deviceId: string, The ID of the device. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 body: object, The request body.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000362 The object takes the form of:
363
364{ # The state of a user's device, as accessed by the getState and setState methods on device resources.
Dan O'Mearadd494642020-05-01 07:42:23 -0700365 "kind": "androidenterprise#deviceState",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700366 "accountState": "A String", # The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state.
367}
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000368
369
370Returns:
371 An object of the form:
372
373 { # The state of a user's device, as accessed by the getState and setState methods on device resources.
Dan O'Mearadd494642020-05-01 07:42:23 -0700374 "kind": "androidenterprise#deviceState",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700375 "accountState": "A String", # The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state.
376 }</pre>
377</div>
378
379<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700380 <code class="details" id="update">update(enterpriseId, userId, deviceId, body=None, updateMask=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 <pre>Updates the device policy
382
383Args:
384 enterpriseId: string, The ID of the enterprise. (required)
385 userId: string, The ID of the user. (required)
386 deviceId: string, The ID of the device. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700387 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700388 The object takes the form of:
389
390{ # A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.
391 "policy": { # The device policy for a given managed device. # The policy enforced on the device.
392 "autoUpdatePolicy": "A String", # The auto-update policy for apps installed on the device. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi.
393 "maintenanceWindow": { # Maintenance window for managed Google Play Accounts. This allows Play store to update the apps on the foreground in the designated window. # The maintenance window defining when apps running in the foreground should be updated.
394 "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
395 "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
396 },
397 "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
Dan O'Mearadd494642020-05-01 07:42:23 -0700398 "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 { # The policy for a product.
400 "autoInstallPolicy": { # The auto-install policy for the product.
401 "autoInstallMode": "A String", # The auto-install mode. If unset defaults to "doNotAutoInstall".
402 "autoInstallConstraint": [ # The constraints for auto-installing the app. You can specify a maximum of one constraint.
403 { # The auto-install constraint. Defines a set of restrictions for installation. At least one of the fields must be set.
404 "chargingStateConstraint": "A String", # Charging state constraint.
405 "deviceIdleStateConstraint": "A String", # Device idle state constraint.
406 "networkTypeConstraint": "A String", # Network type constraint.
407 },
408 ],
409 "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
Dan O'Mearadd494642020-05-01 07:42:23 -0700410 "minimumVersionCode": 42, # The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700411 },
412 "tracks": [ # Deprecated. Use trackIds instead.
413 "A String",
414 ],
415 "managedConfiguration": { # A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user. # The managed configuration for the product.
Dan O'Mearadd494642020-05-01 07:42:23 -0700416 "kind": "A String", # Deprecated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700417 "configurationVariables": { # A configuration variables resource contains the managed configuration settings ID to be applied to a single user, as well as the variable set that is attributed to the user. The variable set will be used to replace placeholders in the managed configuration settings. # Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 "kind": "androidenterprise#configurationVariables",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700419 "variableSet": [ # The variable set that is attributed to the user.
420 { # A variable set is a key-value pair of EMM-provided placeholders and its corresponding value, which is attributed to a user. For example, $FIRSTNAME could be a placeholder, and its value could be Alice. Placeholders should start with a '$' sign and should be alphanumeric only.
421 "userValue": "A String", # The value of the placeholder, specific to the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700422 "kind": "androidenterprise#variableSet",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700423 "placeholder": "A String", # The placeholder string; defined by EMM.
424 },
425 ],
426 "mcmId": "A String", # The ID of the managed configurations settings.
427 },
428 "managedProperty": [ # The set of managed properties for this configuration.
429 { # A managed property of a managed configuration. The property must match one of the properties in the app restrictions schema of the product. Exactly one of the value fields must be populated, and it must match the property's type in the app restrictions schema.
430 "key": "A String", # The unique key that identifies the property.
431 "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
432 "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
433 "A String",
434 ],
435 "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
436 "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
437 { # A bundle of managed properties.
438 "managedProperty": [ # The list of managed properties.
439 # Object with schema name: ManagedProperty
440 ],
441 },
442 ],
443 "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
444 "managedProperty": [ # The list of managed properties.
445 # Object with schema name: ManagedProperty
446 ],
447 },
448 "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
449 },
450 ],
451 "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
452 },
453 "trackIds": [ # Grants the device visibility to the specified product release track(s), identified by trackIds. The list of release tracks of a product can be obtained by calling Products.Get.
454 "A String",
455 ],
456 "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
457 },
458 ],
459 "productAvailabilityPolicy": "A String", # The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default.
460 },
461 "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
462 "appState": [ # List of app states set by managed apps on the device. App states are defined by the app's developers. This field will always be present.
463 { # List of states set by the app.
464 "packageName": "A String", # The package name of the app. This field will always be present.
465 "keyedAppState": [ # List of keyed app states. This field will always be present.
466 { # Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data.
467 "message": "A String", # Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
468 "data": "A String", # Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
469 "severity": "A String", # Severity of the app state. This field will always be present.
470 "key": "A String", # Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
471 "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
472 },
473 ],
474 },
475 ],
476 "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
477 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700478 "kind": "androidenterprise#device",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700479 "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.
480 #
481 # Possible values include:
482 # - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
483 # - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
484 # - "containerApp", no longer used (deprecated).
485 # - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.
486 "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
487}
488
489 updateMask: string, Mask that identifies which fields to update. If not set, all modifiable fields will be modified.
490
Dan O'Mearadd494642020-05-01 07:42:23 -0700491When set in a query parameter, this field should be specified as updateMask=&lt;field1&gt;,&lt;field2&gt;,...
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700492
493Returns:
494 An object of the form:
495
496 { # A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.
497 "policy": { # The device policy for a given managed device. # The policy enforced on the device.
498 "autoUpdatePolicy": "A String", # The auto-update policy for apps installed on the device. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi.
499 "maintenanceWindow": { # Maintenance window for managed Google Play Accounts. This allows Play store to update the apps on the foreground in the designated window. # The maintenance window defining when apps running in the foreground should be updated.
500 "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
501 "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
502 },
503 "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
Dan O'Mearadd494642020-05-01 07:42:23 -0700504 "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700505 { # The policy for a product.
506 "autoInstallPolicy": { # The auto-install policy for the product.
507 "autoInstallMode": "A String", # The auto-install mode. If unset defaults to "doNotAutoInstall".
508 "autoInstallConstraint": [ # The constraints for auto-installing the app. You can specify a maximum of one constraint.
509 { # The auto-install constraint. Defines a set of restrictions for installation. At least one of the fields must be set.
510 "chargingStateConstraint": "A String", # Charging state constraint.
511 "deviceIdleStateConstraint": "A String", # Device idle state constraint.
512 "networkTypeConstraint": "A String", # Network type constraint.
513 },
514 ],
515 "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
Dan O'Mearadd494642020-05-01 07:42:23 -0700516 "minimumVersionCode": 42, # The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update. You can set a minimum version code for at most 20 apps per device.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700517 },
518 "tracks": [ # Deprecated. Use trackIds instead.
519 "A String",
520 ],
521 "managedConfiguration": { # A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user. # The managed configuration for the product.
Dan O'Mearadd494642020-05-01 07:42:23 -0700522 "kind": "A String", # Deprecated.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700523 "configurationVariables": { # A configuration variables resource contains the managed configuration settings ID to be applied to a single user, as well as the variable set that is attributed to the user. The variable set will be used to replace placeholders in the managed configuration settings. # Contains the ID of the managed configuration profile and the set of configuration variables (if any) defined for the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700524 "kind": "androidenterprise#configurationVariables",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700525 "variableSet": [ # The variable set that is attributed to the user.
526 { # A variable set is a key-value pair of EMM-provided placeholders and its corresponding value, which is attributed to a user. For example, $FIRSTNAME could be a placeholder, and its value could be Alice. Placeholders should start with a '$' sign and should be alphanumeric only.
527 "userValue": "A String", # The value of the placeholder, specific to the user.
Dan O'Mearadd494642020-05-01 07:42:23 -0700528 "kind": "androidenterprise#variableSet",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700529 "placeholder": "A String", # The placeholder string; defined by EMM.
530 },
531 ],
532 "mcmId": "A String", # The ID of the managed configurations settings.
533 },
534 "managedProperty": [ # The set of managed properties for this configuration.
535 { # A managed property of a managed configuration. The property must match one of the properties in the app restrictions schema of the product. Exactly one of the value fields must be populated, and it must match the property's type in the app restrictions schema.
536 "key": "A String", # The unique key that identifies the property.
537 "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
538 "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
539 "A String",
540 ],
541 "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
542 "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
543 { # A bundle of managed properties.
544 "managedProperty": [ # The list of managed properties.
545 # Object with schema name: ManagedProperty
546 ],
547 },
548 ],
549 "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
550 "managedProperty": [ # The list of managed properties.
551 # Object with schema name: ManagedProperty
552 ],
553 },
554 "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
555 },
556 ],
557 "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
558 },
559 "trackIds": [ # Grants the device visibility to the specified product release track(s), identified by trackIds. The list of release tracks of a product can be obtained by calling Products.Get.
560 "A String",
561 ],
562 "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
563 },
564 ],
565 "productAvailabilityPolicy": "A String", # The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default.
566 },
567 "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
568 "appState": [ # List of app states set by managed apps on the device. App states are defined by the app's developers. This field will always be present.
569 { # List of states set by the app.
570 "packageName": "A String", # The package name of the app. This field will always be present.
571 "keyedAppState": [ # List of keyed app states. This field will always be present.
572 { # Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data.
573 "message": "A String", # Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
574 "data": "A String", # Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
575 "severity": "A String", # Severity of the app state. This field will always be present.
576 "key": "A String", # Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
577 "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
578 },
579 ],
580 },
581 ],
582 "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
583 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700584 "kind": "androidenterprise#device",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700585 "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.
586 #
587 # Possible values include:
588 # - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
589 # - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
590 # - "containerApp", no longer used (deprecated).
591 # - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.
592 "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
593 }</pre>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000594</div>
595
596</body></html>