blob: 34c295c2bccbbc337c6cce67c1897dac426d9783 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="androidenterprise_v1.html">Google Play EMM API</a> . <a href="androidenterprise_v1.devices.html">devices</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#forceReportUpload">forceReportUpload(enterpriseId, userId, deviceId, x__xgafv=None)</a></code></p>
<p class="firstline">Uploads a report containing any changes in app states on the device since</p>
<p class="toc_element">
<code><a href="#get">get(enterpriseId, userId, deviceId, x__xgafv=None)</a></code></p>
<p class="firstline">Retrieves the details of a device.</p>
<p class="toc_element">
<code><a href="#getState">getState(enterpriseId, userId, deviceId, x__xgafv=None)</a></code></p>
<p class="firstline">Retrieves whether a device's access to Google services is enabled or</p>
<p class="toc_element">
<code><a href="#list">list(enterpriseId, userId, x__xgafv=None)</a></code></p>
<p class="firstline">Retrieves the IDs of all of a user's devices.</p>
<p class="toc_element">
<code><a href="#setState">setState(enterpriseId, userId, deviceId, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Sets whether a device's access to Google services is enabled or disabled.</p>
<p class="toc_element">
<code><a href="#update">update(enterpriseId, userId, deviceId, body=None, updateMask=None, x__xgafv=None)</a></code></p>
<p class="firstline">Updates the device policy</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="forceReportUpload">forceReportUpload(enterpriseId, userId, deviceId, x__xgafv=None)</code>
<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.
If you exceed the quota, then the Google Play EMM API returns &lt;code&gt;HTTP
429 Too Many Requests&lt;/code&gt;.
Args:
enterpriseId: string, The ID of the enterprise. (required)
userId: string, The ID of the user. (required)
deviceId: string, The ID of the device. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
</pre>
</div>
<div class="method">
<code class="details" id="get">get(enterpriseId, userId, deviceId, x__xgafv=None)</code>
<pre>Retrieves the details of a device.
Args:
enterpriseId: string, The ID of the enterprise. (required)
userId: string, The ID of the user. (required)
deviceId: string, The ID of the device. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A Devices resource represents a mobile device managed by the EMM and
# belonging to a specific enterprise user.
&quot;managementType&quot;: &quot;A String&quot;, # Identifies the extent to which the device is controlled by a managed
# Google Play EMM in various deployment configurations. &lt;br&gt;&lt;br&gt;
# Possible values include:
# &lt;ul&gt;&lt;li&gt;&quot;&lt;code&gt;managedDevice&lt;/code&gt;&quot;, a device that has the EMM&#x27;s device
# policy controller (DPC) as the device owner.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;managedProfile&lt;/code&gt;&quot;, 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.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;containerApp&lt;/code&gt;&quot;, no longer used (deprecated).&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;unmanagedProfile&lt;/code&gt;&quot;, a device that has been allowed (by the
# domain&#x27;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.&lt;/li&gt;&lt;/ul&gt;
&quot;report&quot;: { # Device report updated with the latest app states for managed apps on the # The device report updated with the latest app states.
# device.
&quot;appState&quot;: [ # List of app states set by managed apps on the device. App states are
# defined by the app&#x27;s developers.
# This field will always be present.
{ # List of states set by the app.
&quot;packageName&quot;: &quot;A String&quot;, # The package name of the app.
# This field will always be present.
&quot;keyedAppState&quot;: [ # List of keyed app states.
# This field will always be present.
{ # Represents a keyed app state containing a key, timestamp, severity level,
# optional description, and optional data.
&quot;stateTimestampMillis&quot;: &quot;A String&quot;, # Timestamp of when the app set the state in milliseconds since epoch.
# This field will always be present.
&quot;severity&quot;: &quot;A String&quot;, # Severity of the app state.
# This field will always be present.
&quot;message&quot;: &quot;A String&quot;, # 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.
&quot;key&quot;: &quot;A String&quot;, # Key indicating what the app is providing a state for. The content of the
# key is set by the app&#x27;s developer. To prevent XSS, we recommend removing
# any HTML from the key before displaying it.
# This field will always be present.
&quot;data&quot;: &quot;A String&quot;, # 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.
},
],
},
],
&quot;lastUpdatedTimestampMillis&quot;: &quot;A String&quot;, # The timestamp of the last report update in milliseconds since epoch.
# This field will always be present.
},
&quot;policy&quot;: { # The device policy for a given managed device. # The policy enforced on the device.
&quot;maintenanceWindow&quot;: { # Maintenance window for managed Google Play Accounts. # The maintenance window defining when apps running in the foreground should
# be updated.
# This allows Play store to update the apps on the foreground in the designated
# window.
&quot;durationMs&quot;: &quot;A String&quot;, # Duration of the maintenance window, in milliseconds. The duration must be
# between 30 minutes and 24 hours (inclusive).
&quot;startTimeAfterMidnightMs&quot;: &quot;A String&quot;, # Start time of the maintenance window, in milliseconds after midnight on the
# device. Windows can span midnight.
},
&quot;deviceReportPolicy&quot;: &quot;A String&quot;, # Whether the device reports app states to the EMM. The default value is
# &quot;deviceReportDisabled&quot;.
&quot;autoUpdatePolicy&quot;: &quot;A String&quot;, # The auto-update policy for apps installed on the device. &quot;choiceToTheUser&quot;
# allows the device&#x27;s user to configure the app update policy. &quot;always&quot;
# enables auto updates. &quot;never&quot; disables auto updates. &quot;wifiOnly&quot; enables
# auto updates only when the device is connected to wifi.
&quot;productAvailabilityPolicy&quot;: &quot;A String&quot;, # The availability granted to the device for the specified products. &quot;all&quot;
# gives the device access to all products, regardless of approval status.
# &quot;all&quot; does not enable automatic visibility of &quot;alpha&quot; or &quot;beta&quot; tracks.
# &quot;whitelist&quot; 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.
&quot;productPolicy&quot;: [ # The list of product policies. The &lt;code&gt;productAvailabilityPolicy&lt;/code&gt;
# needs to be set to &lt;code&gt;WHITELIST&lt;/code&gt; or &lt;code&gt;ALL&lt;/code&gt; for the
# product policies to be applied.
{ # The policy for a product.
&quot;tracks&quot;: [ # Deprecated. Use &lt;code&gt;trackIds&lt;/code&gt; instead.
&quot;A String&quot;,
],
&quot;trackIds&quot;: [ # Grants the device visibility to the specified product release track(s),
# identified by &lt;code&gt;trackIds&lt;/code&gt;. The list of release tracks of a
# product can be obtained by calling Products.Get.
&quot;A String&quot;,
],
&quot;managedConfiguration&quot;: { # A managed configuration resource contains the set of managed properties # The managed configuration for the product.
# defined by the app developer in the app&#x27;s managed configurations schema,
# as well as any configuration variables defined for the user.
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product that the managed configuration is for, e.g.
# &quot;app:com.google.android.gm&quot;.
&quot;configurationVariables&quot;: { # A configuration variables resource contains the managed configuration # Contains the ID of the managed configuration profile and the set of
# configuration variables (if any) defined for the user.
# 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.
&quot;mcmId&quot;: &quot;A String&quot;, # The ID of the managed configurations settings.
&quot;variableSet&quot;: [ # The variable set that is attributed to the user.
{ # 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 &#x27;$&#x27; sign and should be alphanumeric only.
&quot;userValue&quot;: &quot;A String&quot;, # The value of the placeholder, specific to the user.
&quot;placeholder&quot;: &quot;A String&quot;, # The placeholder string; defined by EMM.
},
],
},
&quot;managedProperty&quot;: [ # The set of managed properties for this configuration.
{ # 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&#x27;s type in
# the app restrictions schema.
&quot;valueInteger&quot;: 42, # The integer value - this will only be present if type of the property is
# integer.
&quot;valueBool&quot;: True or False, # The boolean value - this will only be present if type of the property is
# bool.
&quot;valueString&quot;: &quot;A String&quot;, # The string value - this will only be present if type of the property is
# string, choice or hidden.
&quot;valueBundle&quot;: { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the
# property is bundle.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
&quot;valueBundleArray&quot;: [ # The list of bundles of properties - this will only be present if type of
# the property is bundle_array.
{ # A bundle of managed properties.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
],
&quot;valueStringArray&quot;: [ # The list of string values - this will only be present if type of the
# property is multiselect.
&quot;A String&quot;,
],
&quot;key&quot;: &quot;A String&quot;, # The unique key that identifies the property.
},
],
&quot;kind&quot;: &quot;A String&quot;, # Deprecated.
},
&quot;autoInstallPolicy&quot;: { # The auto-install policy for the product.
&quot;autoInstallPriority&quot;: 42, # The priority of the install, as an unsigned integer. A lower number means
# higher priority.
&quot;autoInstallMode&quot;: &quot;A String&quot;, # The auto-install mode. If unset defaults to &quot;doNotAutoInstall&quot;.
&quot;autoInstallConstraint&quot;: [ # The constraints for auto-installing the app. You can specify a maximum of
# one constraint.
{ # The auto-install constraint. Defines a set of restrictions for installation.
# At least one of the fields must be set.
&quot;networkTypeConstraint&quot;: &quot;A String&quot;, # Network type constraint.
&quot;deviceIdleStateConstraint&quot;: &quot;A String&quot;, # Device idle state constraint.
&quot;chargingStateConstraint&quot;: &quot;A String&quot;, # Charging state constraint.
},
],
&quot;minimumVersionCode&quot;: 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.
},
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product. For example,
# &lt;code&gt;&amp;quot;app:com.google.android.gm&amp;quot;&lt;/code&gt;.
},
],
},
&quot;androidId&quot;: &quot;A String&quot;, # The Google Play Services Android ID for the device encoded as
# a lowercase hex string. For example,
# &lt;code&gt;&amp;quot;123456789abcdef0&amp;quot;&lt;/code&gt;.
}</pre>
</div>
<div class="method">
<code class="details" id="getState">getState(enterpriseId, userId, deviceId, x__xgafv=None)</code>
<pre>Retrieves whether a device&#x27;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.
Args:
enterpriseId: string, The ID of the enterprise. (required)
userId: string, The ID of the user. (required)
deviceId: string, The ID of the device. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The state of a user&#x27;s device, as accessed by the getState and setState
# methods on device resources.
&quot;accountState&quot;: &quot;A String&quot;, # The state of the Google account on the device. &quot;enabled&quot; indicates that
# the Google account on the device can be used to access Google services
# (including Google Play), while &quot;disabled&quot; means that it cannot.
# A new device is initially in the &quot;disabled&quot; state.
}</pre>
</div>
<div class="method">
<code class="details" id="list">list(enterpriseId, userId, x__xgafv=None)</code>
<pre>Retrieves the IDs of all of a user&#x27;s devices.
Args:
enterpriseId: string, The ID of the enterprise. (required)
userId: string, The ID of the user. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{
&quot;device&quot;: [ # A managed device.
{ # A Devices resource represents a mobile device managed by the EMM and
# belonging to a specific enterprise user.
&quot;managementType&quot;: &quot;A String&quot;, # Identifies the extent to which the device is controlled by a managed
# Google Play EMM in various deployment configurations. &lt;br&gt;&lt;br&gt;
# Possible values include:
# &lt;ul&gt;&lt;li&gt;&quot;&lt;code&gt;managedDevice&lt;/code&gt;&quot;, a device that has the EMM&#x27;s device
# policy controller (DPC) as the device owner.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;managedProfile&lt;/code&gt;&quot;, 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.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;containerApp&lt;/code&gt;&quot;, no longer used (deprecated).&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;unmanagedProfile&lt;/code&gt;&quot;, a device that has been allowed (by the
# domain&#x27;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.&lt;/li&gt;&lt;/ul&gt;
&quot;report&quot;: { # Device report updated with the latest app states for managed apps on the # The device report updated with the latest app states.
# device.
&quot;appState&quot;: [ # List of app states set by managed apps on the device. App states are
# defined by the app&#x27;s developers.
# This field will always be present.
{ # List of states set by the app.
&quot;packageName&quot;: &quot;A String&quot;, # The package name of the app.
# This field will always be present.
&quot;keyedAppState&quot;: [ # List of keyed app states.
# This field will always be present.
{ # Represents a keyed app state containing a key, timestamp, severity level,
# optional description, and optional data.
&quot;stateTimestampMillis&quot;: &quot;A String&quot;, # Timestamp of when the app set the state in milliseconds since epoch.
# This field will always be present.
&quot;severity&quot;: &quot;A String&quot;, # Severity of the app state.
# This field will always be present.
&quot;message&quot;: &quot;A String&quot;, # 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.
&quot;key&quot;: &quot;A String&quot;, # Key indicating what the app is providing a state for. The content of the
# key is set by the app&#x27;s developer. To prevent XSS, we recommend removing
# any HTML from the key before displaying it.
# This field will always be present.
&quot;data&quot;: &quot;A String&quot;, # 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.
},
],
},
],
&quot;lastUpdatedTimestampMillis&quot;: &quot;A String&quot;, # The timestamp of the last report update in milliseconds since epoch.
# This field will always be present.
},
&quot;policy&quot;: { # The device policy for a given managed device. # The policy enforced on the device.
&quot;maintenanceWindow&quot;: { # Maintenance window for managed Google Play Accounts. # The maintenance window defining when apps running in the foreground should
# be updated.
# This allows Play store to update the apps on the foreground in the designated
# window.
&quot;durationMs&quot;: &quot;A String&quot;, # Duration of the maintenance window, in milliseconds. The duration must be
# between 30 minutes and 24 hours (inclusive).
&quot;startTimeAfterMidnightMs&quot;: &quot;A String&quot;, # Start time of the maintenance window, in milliseconds after midnight on the
# device. Windows can span midnight.
},
&quot;deviceReportPolicy&quot;: &quot;A String&quot;, # Whether the device reports app states to the EMM. The default value is
# &quot;deviceReportDisabled&quot;.
&quot;autoUpdatePolicy&quot;: &quot;A String&quot;, # The auto-update policy for apps installed on the device. &quot;choiceToTheUser&quot;
# allows the device&#x27;s user to configure the app update policy. &quot;always&quot;
# enables auto updates. &quot;never&quot; disables auto updates. &quot;wifiOnly&quot; enables
# auto updates only when the device is connected to wifi.
&quot;productAvailabilityPolicy&quot;: &quot;A String&quot;, # The availability granted to the device for the specified products. &quot;all&quot;
# gives the device access to all products, regardless of approval status.
# &quot;all&quot; does not enable automatic visibility of &quot;alpha&quot; or &quot;beta&quot; tracks.
# &quot;whitelist&quot; 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.
&quot;productPolicy&quot;: [ # The list of product policies. The &lt;code&gt;productAvailabilityPolicy&lt;/code&gt;
# needs to be set to &lt;code&gt;WHITELIST&lt;/code&gt; or &lt;code&gt;ALL&lt;/code&gt; for the
# product policies to be applied.
{ # The policy for a product.
&quot;tracks&quot;: [ # Deprecated. Use &lt;code&gt;trackIds&lt;/code&gt; instead.
&quot;A String&quot;,
],
&quot;trackIds&quot;: [ # Grants the device visibility to the specified product release track(s),
# identified by &lt;code&gt;trackIds&lt;/code&gt;. The list of release tracks of a
# product can be obtained by calling Products.Get.
&quot;A String&quot;,
],
&quot;managedConfiguration&quot;: { # A managed configuration resource contains the set of managed properties # The managed configuration for the product.
# defined by the app developer in the app&#x27;s managed configurations schema,
# as well as any configuration variables defined for the user.
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product that the managed configuration is for, e.g.
# &quot;app:com.google.android.gm&quot;.
&quot;configurationVariables&quot;: { # A configuration variables resource contains the managed configuration # Contains the ID of the managed configuration profile and the set of
# configuration variables (if any) defined for the user.
# 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.
&quot;mcmId&quot;: &quot;A String&quot;, # The ID of the managed configurations settings.
&quot;variableSet&quot;: [ # The variable set that is attributed to the user.
{ # 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 &#x27;$&#x27; sign and should be alphanumeric only.
&quot;userValue&quot;: &quot;A String&quot;, # The value of the placeholder, specific to the user.
&quot;placeholder&quot;: &quot;A String&quot;, # The placeholder string; defined by EMM.
},
],
},
&quot;managedProperty&quot;: [ # The set of managed properties for this configuration.
{ # 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&#x27;s type in
# the app restrictions schema.
&quot;valueInteger&quot;: 42, # The integer value - this will only be present if type of the property is
# integer.
&quot;valueBool&quot;: True or False, # The boolean value - this will only be present if type of the property is
# bool.
&quot;valueString&quot;: &quot;A String&quot;, # The string value - this will only be present if type of the property is
# string, choice or hidden.
&quot;valueBundle&quot;: { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the
# property is bundle.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
&quot;valueBundleArray&quot;: [ # The list of bundles of properties - this will only be present if type of
# the property is bundle_array.
{ # A bundle of managed properties.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
],
&quot;valueStringArray&quot;: [ # The list of string values - this will only be present if type of the
# property is multiselect.
&quot;A String&quot;,
],
&quot;key&quot;: &quot;A String&quot;, # The unique key that identifies the property.
},
],
&quot;kind&quot;: &quot;A String&quot;, # Deprecated.
},
&quot;autoInstallPolicy&quot;: { # The auto-install policy for the product.
&quot;autoInstallPriority&quot;: 42, # The priority of the install, as an unsigned integer. A lower number means
# higher priority.
&quot;autoInstallMode&quot;: &quot;A String&quot;, # The auto-install mode. If unset defaults to &quot;doNotAutoInstall&quot;.
&quot;autoInstallConstraint&quot;: [ # The constraints for auto-installing the app. You can specify a maximum of
# one constraint.
{ # The auto-install constraint. Defines a set of restrictions for installation.
# At least one of the fields must be set.
&quot;networkTypeConstraint&quot;: &quot;A String&quot;, # Network type constraint.
&quot;deviceIdleStateConstraint&quot;: &quot;A String&quot;, # Device idle state constraint.
&quot;chargingStateConstraint&quot;: &quot;A String&quot;, # Charging state constraint.
},
],
&quot;minimumVersionCode&quot;: 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.
},
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product. For example,
# &lt;code&gt;&amp;quot;app:com.google.android.gm&amp;quot;&lt;/code&gt;.
},
],
},
&quot;androidId&quot;: &quot;A String&quot;, # The Google Play Services Android ID for the device encoded as
# a lowercase hex string. For example,
# &lt;code&gt;&amp;quot;123456789abcdef0&amp;quot;&lt;/code&gt;.
},
],
}</pre>
</div>
<div class="method">
<code class="details" id="setState">setState(enterpriseId, userId, deviceId, body=None, x__xgafv=None)</code>
<pre>Sets whether a device&#x27;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.
Args:
enterpriseId: string, The ID of the enterprise. (required)
userId: string, The ID of the user. (required)
deviceId: string, The ID of the device. (required)
body: object, The request body.
The object takes the form of:
{ # The state of a user&#x27;s device, as accessed by the getState and setState
# methods on device resources.
&quot;accountState&quot;: &quot;A String&quot;, # The state of the Google account on the device. &quot;enabled&quot; indicates that
# the Google account on the device can be used to access Google services
# (including Google Play), while &quot;disabled&quot; means that it cannot.
# A new device is initially in the &quot;disabled&quot; state.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # The state of a user&#x27;s device, as accessed by the getState and setState
# methods on device resources.
&quot;accountState&quot;: &quot;A String&quot;, # The state of the Google account on the device. &quot;enabled&quot; indicates that
# the Google account on the device can be used to access Google services
# (including Google Play), while &quot;disabled&quot; means that it cannot.
# A new device is initially in the &quot;disabled&quot; state.
}</pre>
</div>
<div class="method">
<code class="details" id="update">update(enterpriseId, userId, deviceId, body=None, updateMask=None, x__xgafv=None)</code>
<pre>Updates the device policy
Args:
enterpriseId: string, The ID of the enterprise. (required)
userId: string, The ID of the user. (required)
deviceId: string, The ID of the device. (required)
body: object, The request body.
The object takes the form of:
{ # A Devices resource represents a mobile device managed by the EMM and
# belonging to a specific enterprise user.
&quot;managementType&quot;: &quot;A String&quot;, # Identifies the extent to which the device is controlled by a managed
# Google Play EMM in various deployment configurations. &lt;br&gt;&lt;br&gt;
# Possible values include:
# &lt;ul&gt;&lt;li&gt;&quot;&lt;code&gt;managedDevice&lt;/code&gt;&quot;, a device that has the EMM&#x27;s device
# policy controller (DPC) as the device owner.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;managedProfile&lt;/code&gt;&quot;, 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.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;containerApp&lt;/code&gt;&quot;, no longer used (deprecated).&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;unmanagedProfile&lt;/code&gt;&quot;, a device that has been allowed (by the
# domain&#x27;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.&lt;/li&gt;&lt;/ul&gt;
&quot;report&quot;: { # Device report updated with the latest app states for managed apps on the # The device report updated with the latest app states.
# device.
&quot;appState&quot;: [ # List of app states set by managed apps on the device. App states are
# defined by the app&#x27;s developers.
# This field will always be present.
{ # List of states set by the app.
&quot;packageName&quot;: &quot;A String&quot;, # The package name of the app.
# This field will always be present.
&quot;keyedAppState&quot;: [ # List of keyed app states.
# This field will always be present.
{ # Represents a keyed app state containing a key, timestamp, severity level,
# optional description, and optional data.
&quot;stateTimestampMillis&quot;: &quot;A String&quot;, # Timestamp of when the app set the state in milliseconds since epoch.
# This field will always be present.
&quot;severity&quot;: &quot;A String&quot;, # Severity of the app state.
# This field will always be present.
&quot;message&quot;: &quot;A String&quot;, # 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.
&quot;key&quot;: &quot;A String&quot;, # Key indicating what the app is providing a state for. The content of the
# key is set by the app&#x27;s developer. To prevent XSS, we recommend removing
# any HTML from the key before displaying it.
# This field will always be present.
&quot;data&quot;: &quot;A String&quot;, # 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.
},
],
},
],
&quot;lastUpdatedTimestampMillis&quot;: &quot;A String&quot;, # The timestamp of the last report update in milliseconds since epoch.
# This field will always be present.
},
&quot;policy&quot;: { # The device policy for a given managed device. # The policy enforced on the device.
&quot;maintenanceWindow&quot;: { # Maintenance window for managed Google Play Accounts. # The maintenance window defining when apps running in the foreground should
# be updated.
# This allows Play store to update the apps on the foreground in the designated
# window.
&quot;durationMs&quot;: &quot;A String&quot;, # Duration of the maintenance window, in milliseconds. The duration must be
# between 30 minutes and 24 hours (inclusive).
&quot;startTimeAfterMidnightMs&quot;: &quot;A String&quot;, # Start time of the maintenance window, in milliseconds after midnight on the
# device. Windows can span midnight.
},
&quot;deviceReportPolicy&quot;: &quot;A String&quot;, # Whether the device reports app states to the EMM. The default value is
# &quot;deviceReportDisabled&quot;.
&quot;autoUpdatePolicy&quot;: &quot;A String&quot;, # The auto-update policy for apps installed on the device. &quot;choiceToTheUser&quot;
# allows the device&#x27;s user to configure the app update policy. &quot;always&quot;
# enables auto updates. &quot;never&quot; disables auto updates. &quot;wifiOnly&quot; enables
# auto updates only when the device is connected to wifi.
&quot;productAvailabilityPolicy&quot;: &quot;A String&quot;, # The availability granted to the device for the specified products. &quot;all&quot;
# gives the device access to all products, regardless of approval status.
# &quot;all&quot; does not enable automatic visibility of &quot;alpha&quot; or &quot;beta&quot; tracks.
# &quot;whitelist&quot; 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.
&quot;productPolicy&quot;: [ # The list of product policies. The &lt;code&gt;productAvailabilityPolicy&lt;/code&gt;
# needs to be set to &lt;code&gt;WHITELIST&lt;/code&gt; or &lt;code&gt;ALL&lt;/code&gt; for the
# product policies to be applied.
{ # The policy for a product.
&quot;tracks&quot;: [ # Deprecated. Use &lt;code&gt;trackIds&lt;/code&gt; instead.
&quot;A String&quot;,
],
&quot;trackIds&quot;: [ # Grants the device visibility to the specified product release track(s),
# identified by &lt;code&gt;trackIds&lt;/code&gt;. The list of release tracks of a
# product can be obtained by calling Products.Get.
&quot;A String&quot;,
],
&quot;managedConfiguration&quot;: { # A managed configuration resource contains the set of managed properties # The managed configuration for the product.
# defined by the app developer in the app&#x27;s managed configurations schema,
# as well as any configuration variables defined for the user.
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product that the managed configuration is for, e.g.
# &quot;app:com.google.android.gm&quot;.
&quot;configurationVariables&quot;: { # A configuration variables resource contains the managed configuration # Contains the ID of the managed configuration profile and the set of
# configuration variables (if any) defined for the user.
# 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.
&quot;mcmId&quot;: &quot;A String&quot;, # The ID of the managed configurations settings.
&quot;variableSet&quot;: [ # The variable set that is attributed to the user.
{ # 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 &#x27;$&#x27; sign and should be alphanumeric only.
&quot;userValue&quot;: &quot;A String&quot;, # The value of the placeholder, specific to the user.
&quot;placeholder&quot;: &quot;A String&quot;, # The placeholder string; defined by EMM.
},
],
},
&quot;managedProperty&quot;: [ # The set of managed properties for this configuration.
{ # 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&#x27;s type in
# the app restrictions schema.
&quot;valueInteger&quot;: 42, # The integer value - this will only be present if type of the property is
# integer.
&quot;valueBool&quot;: True or False, # The boolean value - this will only be present if type of the property is
# bool.
&quot;valueString&quot;: &quot;A String&quot;, # The string value - this will only be present if type of the property is
# string, choice or hidden.
&quot;valueBundle&quot;: { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the
# property is bundle.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
&quot;valueBundleArray&quot;: [ # The list of bundles of properties - this will only be present if type of
# the property is bundle_array.
{ # A bundle of managed properties.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
],
&quot;valueStringArray&quot;: [ # The list of string values - this will only be present if type of the
# property is multiselect.
&quot;A String&quot;,
],
&quot;key&quot;: &quot;A String&quot;, # The unique key that identifies the property.
},
],
&quot;kind&quot;: &quot;A String&quot;, # Deprecated.
},
&quot;autoInstallPolicy&quot;: { # The auto-install policy for the product.
&quot;autoInstallPriority&quot;: 42, # The priority of the install, as an unsigned integer. A lower number means
# higher priority.
&quot;autoInstallMode&quot;: &quot;A String&quot;, # The auto-install mode. If unset defaults to &quot;doNotAutoInstall&quot;.
&quot;autoInstallConstraint&quot;: [ # The constraints for auto-installing the app. You can specify a maximum of
# one constraint.
{ # The auto-install constraint. Defines a set of restrictions for installation.
# At least one of the fields must be set.
&quot;networkTypeConstraint&quot;: &quot;A String&quot;, # Network type constraint.
&quot;deviceIdleStateConstraint&quot;: &quot;A String&quot;, # Device idle state constraint.
&quot;chargingStateConstraint&quot;: &quot;A String&quot;, # Charging state constraint.
},
],
&quot;minimumVersionCode&quot;: 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.
},
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product. For example,
# &lt;code&gt;&amp;quot;app:com.google.android.gm&amp;quot;&lt;/code&gt;.
},
],
},
&quot;androidId&quot;: &quot;A String&quot;, # The Google Play Services Android ID for the device encoded as
# a lowercase hex string. For example,
# &lt;code&gt;&amp;quot;123456789abcdef0&amp;quot;&lt;/code&gt;.
}
updateMask: string, Mask that identifies which fields to update. If not set, all modifiable
fields will be modified.
When set in a query parameter, this field should be specified as
&lt;code&gt;updateMask=&amp;lt;field1&amp;gt;,&amp;lt;field2&amp;gt;,...&lt;/code&gt;
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A Devices resource represents a mobile device managed by the EMM and
# belonging to a specific enterprise user.
&quot;managementType&quot;: &quot;A String&quot;, # Identifies the extent to which the device is controlled by a managed
# Google Play EMM in various deployment configurations. &lt;br&gt;&lt;br&gt;
# Possible values include:
# &lt;ul&gt;&lt;li&gt;&quot;&lt;code&gt;managedDevice&lt;/code&gt;&quot;, a device that has the EMM&#x27;s device
# policy controller (DPC) as the device owner.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;managedProfile&lt;/code&gt;&quot;, 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.&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;containerApp&lt;/code&gt;&quot;, no longer used (deprecated).&lt;/li&gt;
# &lt;li&gt;&quot;&lt;code&gt;unmanagedProfile&lt;/code&gt;&quot;, a device that has been allowed (by the
# domain&#x27;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.&lt;/li&gt;&lt;/ul&gt;
&quot;report&quot;: { # Device report updated with the latest app states for managed apps on the # The device report updated with the latest app states.
# device.
&quot;appState&quot;: [ # List of app states set by managed apps on the device. App states are
# defined by the app&#x27;s developers.
# This field will always be present.
{ # List of states set by the app.
&quot;packageName&quot;: &quot;A String&quot;, # The package name of the app.
# This field will always be present.
&quot;keyedAppState&quot;: [ # List of keyed app states.
# This field will always be present.
{ # Represents a keyed app state containing a key, timestamp, severity level,
# optional description, and optional data.
&quot;stateTimestampMillis&quot;: &quot;A String&quot;, # Timestamp of when the app set the state in milliseconds since epoch.
# This field will always be present.
&quot;severity&quot;: &quot;A String&quot;, # Severity of the app state.
# This field will always be present.
&quot;message&quot;: &quot;A String&quot;, # 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.
&quot;key&quot;: &quot;A String&quot;, # Key indicating what the app is providing a state for. The content of the
# key is set by the app&#x27;s developer. To prevent XSS, we recommend removing
# any HTML from the key before displaying it.
# This field will always be present.
&quot;data&quot;: &quot;A String&quot;, # 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.
},
],
},
],
&quot;lastUpdatedTimestampMillis&quot;: &quot;A String&quot;, # The timestamp of the last report update in milliseconds since epoch.
# This field will always be present.
},
&quot;policy&quot;: { # The device policy for a given managed device. # The policy enforced on the device.
&quot;maintenanceWindow&quot;: { # Maintenance window for managed Google Play Accounts. # The maintenance window defining when apps running in the foreground should
# be updated.
# This allows Play store to update the apps on the foreground in the designated
# window.
&quot;durationMs&quot;: &quot;A String&quot;, # Duration of the maintenance window, in milliseconds. The duration must be
# between 30 minutes and 24 hours (inclusive).
&quot;startTimeAfterMidnightMs&quot;: &quot;A String&quot;, # Start time of the maintenance window, in milliseconds after midnight on the
# device. Windows can span midnight.
},
&quot;deviceReportPolicy&quot;: &quot;A String&quot;, # Whether the device reports app states to the EMM. The default value is
# &quot;deviceReportDisabled&quot;.
&quot;autoUpdatePolicy&quot;: &quot;A String&quot;, # The auto-update policy for apps installed on the device. &quot;choiceToTheUser&quot;
# allows the device&#x27;s user to configure the app update policy. &quot;always&quot;
# enables auto updates. &quot;never&quot; disables auto updates. &quot;wifiOnly&quot; enables
# auto updates only when the device is connected to wifi.
&quot;productAvailabilityPolicy&quot;: &quot;A String&quot;, # The availability granted to the device for the specified products. &quot;all&quot;
# gives the device access to all products, regardless of approval status.
# &quot;all&quot; does not enable automatic visibility of &quot;alpha&quot; or &quot;beta&quot; tracks.
# &quot;whitelist&quot; 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.
&quot;productPolicy&quot;: [ # The list of product policies. The &lt;code&gt;productAvailabilityPolicy&lt;/code&gt;
# needs to be set to &lt;code&gt;WHITELIST&lt;/code&gt; or &lt;code&gt;ALL&lt;/code&gt; for the
# product policies to be applied.
{ # The policy for a product.
&quot;tracks&quot;: [ # Deprecated. Use &lt;code&gt;trackIds&lt;/code&gt; instead.
&quot;A String&quot;,
],
&quot;trackIds&quot;: [ # Grants the device visibility to the specified product release track(s),
# identified by &lt;code&gt;trackIds&lt;/code&gt;. The list of release tracks of a
# product can be obtained by calling Products.Get.
&quot;A String&quot;,
],
&quot;managedConfiguration&quot;: { # A managed configuration resource contains the set of managed properties # The managed configuration for the product.
# defined by the app developer in the app&#x27;s managed configurations schema,
# as well as any configuration variables defined for the user.
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product that the managed configuration is for, e.g.
# &quot;app:com.google.android.gm&quot;.
&quot;configurationVariables&quot;: { # A configuration variables resource contains the managed configuration # Contains the ID of the managed configuration profile and the set of
# configuration variables (if any) defined for the user.
# 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.
&quot;mcmId&quot;: &quot;A String&quot;, # The ID of the managed configurations settings.
&quot;variableSet&quot;: [ # The variable set that is attributed to the user.
{ # 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 &#x27;$&#x27; sign and should be alphanumeric only.
&quot;userValue&quot;: &quot;A String&quot;, # The value of the placeholder, specific to the user.
&quot;placeholder&quot;: &quot;A String&quot;, # The placeholder string; defined by EMM.
},
],
},
&quot;managedProperty&quot;: [ # The set of managed properties for this configuration.
{ # 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&#x27;s type in
# the app restrictions schema.
&quot;valueInteger&quot;: 42, # The integer value - this will only be present if type of the property is
# integer.
&quot;valueBool&quot;: True or False, # The boolean value - this will only be present if type of the property is
# bool.
&quot;valueString&quot;: &quot;A String&quot;, # The string value - this will only be present if type of the property is
# string, choice or hidden.
&quot;valueBundle&quot;: { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the
# property is bundle.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
&quot;valueBundleArray&quot;: [ # The list of bundles of properties - this will only be present if type of
# the property is bundle_array.
{ # A bundle of managed properties.
&quot;managedProperty&quot;: [ # The list of managed properties.
# Object with schema name: ManagedProperty
],
},
],
&quot;valueStringArray&quot;: [ # The list of string values - this will only be present if type of the
# property is multiselect.
&quot;A String&quot;,
],
&quot;key&quot;: &quot;A String&quot;, # The unique key that identifies the property.
},
],
&quot;kind&quot;: &quot;A String&quot;, # Deprecated.
},
&quot;autoInstallPolicy&quot;: { # The auto-install policy for the product.
&quot;autoInstallPriority&quot;: 42, # The priority of the install, as an unsigned integer. A lower number means
# higher priority.
&quot;autoInstallMode&quot;: &quot;A String&quot;, # The auto-install mode. If unset defaults to &quot;doNotAutoInstall&quot;.
&quot;autoInstallConstraint&quot;: [ # The constraints for auto-installing the app. You can specify a maximum of
# one constraint.
{ # The auto-install constraint. Defines a set of restrictions for installation.
# At least one of the fields must be set.
&quot;networkTypeConstraint&quot;: &quot;A String&quot;, # Network type constraint.
&quot;deviceIdleStateConstraint&quot;: &quot;A String&quot;, # Device idle state constraint.
&quot;chargingStateConstraint&quot;: &quot;A String&quot;, # Charging state constraint.
},
],
&quot;minimumVersionCode&quot;: 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.
},
&quot;productId&quot;: &quot;A String&quot;, # The ID of the product. For example,
# &lt;code&gt;&amp;quot;app:com.google.android.gm&amp;quot;&lt;/code&gt;.
},
],
},
&quot;androidId&quot;: &quot;A String&quot;, # The Google Play Services Android ID for the device encoded as
# a lowercase hex string. For example,
# &lt;code&gt;&amp;quot;123456789abcdef0&amp;quot;&lt;/code&gt;.
}</pre>
</div>
</body></html>