Google Play EMM API . devices

Instance Methods

close()

Close httplib2 connections.

forceReportUpload(enterpriseId, userId, deviceId, x__xgafv=None)

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 HTTP 429 Too Many Requests.

get(enterpriseId, userId, deviceId, x__xgafv=None)

Retrieves the details of a device.

getState(enterpriseId, userId, deviceId, x__xgafv=None)

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.

list(enterpriseId, userId, x__xgafv=None)

Retrieves the IDs of all of a user's devices.

setState(enterpriseId, userId, deviceId, body=None, x__xgafv=None)

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.

update(enterpriseId, userId, deviceId, body=None, updateMask=None, x__xgafv=None)

Updates the device policy. To ensure the policy is properly enforced, you need to prevent unmanaged accounts from accessing Google Play by setting the allowed_accounts in the managed configuration for the Google Play package. See restrict accounts in Google Play. When provisioning a new device, you should set the device policy using this method before adding the managed Google Play Account to the device, otherwise the policy will not be applied for a short period of time after adding the account to the device.

Method Details

close()
Close httplib2 connections.
forceReportUpload(enterpriseId, userId, deviceId, x__xgafv=None)
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 HTTP 429 Too Many Requests.

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
get(enterpriseId, userId, deviceId, x__xgafv=None)
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.
  "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
  "device": "A String", # The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named "device" per logs/wireless/android/android_checkin.proto)
  "latestBuildFingerprint": "A String", # The build fingerprint of the device if known.
  "maker": "A String", # The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.
  "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. Possible values include: - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. - "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. - "containerApp", no longer used (deprecated). - "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.
  "model": "A String", # The model name of the device. This comes from android.os.Build.MODEL.
  "policy": { # The device policy for a given managed device. # The policy enforced on the device.
    "autoUpdatePolicy": "A String", # Controls when automatic app updates on the device can be applied. Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency. When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, autoUpdatePolicy has no effect. "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.
    "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
    "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.
      "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
      "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
    },
    "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.
    "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
      { # The policy for a product.
        "autoInstallPolicy": { # The auto-install policy for the product.
          "autoInstallConstraint": [ # 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.
              "chargingStateConstraint": "A String", # Charging state constraint.
              "deviceIdleStateConstraint": "A String", # Device idle state constraint.
              "networkTypeConstraint": "A String", # Network type constraint.
            },
          ],
          "autoInstallMode": "A String", # The auto-install mode. If unset, defaults to "doNotAutoInstall". An app is automatically installed regardless of a set maintenance window.
          "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
          "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.
        },
        "autoUpdateMode": "A String", # The auto-update mode for the product. When autoUpdateMode is used, it always takes precedence over the user's choice. So when a user makes changes to the device settings manually, these changes are ignored.
        "enterpriseAuthenticationAppLinkConfigs": [ # An authentication URL configuration for the authenticator app of an identity provider. This helps to launch the identity provider's authenticator app during the authentication happening in a private app using Android WebView. Authenticator app should already be the default handler for the authentication url on the device.
          { # An authentication URL configuration for the authenticator app of an identity provider.
            "uri": "A String", # An authentication url.
          },
        ],
        "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.
          "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.
            "mcmId": "A String", # The ID of the managed configurations settings.
            "variableSet": [ # 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 '$' sign and should be alphanumeric only.
                "placeholder": "A String", # The placeholder string; defined by EMM.
                "userValue": "A String", # The value of the placeholder, specific to the user.
              },
            ],
          },
          "kind": "A String", # Deprecated.
          "managedProperty": [ # 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's type in the app restrictions schema.
              "key": "A String", # The unique key that identifies the property.
              "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
              "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
                "managedProperty": [ # The list of managed properties.
                  # Object with schema name: ManagedProperty
                ],
              },
              "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
                { # A bundle of managed properties.
                  "managedProperty": [ # The list of managed properties.
                    # Object with schema name: ManagedProperty
                  ],
                },
              ],
              "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
              "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
              "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
                "A String",
              ],
            },
          ],
          "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
        },
        "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
        "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.
          "A String",
        ],
        "tracks": [ # Deprecated. Use trackIds instead.
          "A String",
        ],
      },
    ],
  },
  "product": "A String", # The product name of the device. This comes from android.os.Build.PRODUCT.
  "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
    "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.
      { # List of states set by the app.
        "keyedAppState": [ # 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.
            "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.
            "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.
            "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.
            "severity": "A String", # Severity of the app state. This field will always be present.
            "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
          },
        ],
        "packageName": "A String", # The package name of the app. This field will always be present.
      },
    ],
    "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
  },
  "retailBrand": "A String", # Retail brand for the device, if set. See android.os.Build.BRAND
  "sdkVersion": 42, # API compatibility version.
}
getState(enterpriseId, userId, deviceId, x__xgafv=None)
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.

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's device, as accessed by the getState and setState methods on device resources.
  "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.
}
list(enterpriseId, userId, x__xgafv=None)
Retrieves the IDs of all of a user'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:

    {
  "device": [ # A managed device.
    { # A Devices resource represents a mobile device managed by the EMM and belonging to a specific enterprise user.
      "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
      "device": "A String", # The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named "device" per logs/wireless/android/android_checkin.proto)
      "latestBuildFingerprint": "A String", # The build fingerprint of the device if known.
      "maker": "A String", # The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.
      "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. Possible values include: - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. - "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. - "containerApp", no longer used (deprecated). - "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.
      "model": "A String", # The model name of the device. This comes from android.os.Build.MODEL.
      "policy": { # The device policy for a given managed device. # The policy enforced on the device.
        "autoUpdatePolicy": "A String", # Controls when automatic app updates on the device can be applied. Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency. When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, autoUpdatePolicy has no effect. "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.
        "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
        "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.
          "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
          "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
        },
        "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.
        "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
          { # The policy for a product.
            "autoInstallPolicy": { # The auto-install policy for the product.
              "autoInstallConstraint": [ # 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.
                  "chargingStateConstraint": "A String", # Charging state constraint.
                  "deviceIdleStateConstraint": "A String", # Device idle state constraint.
                  "networkTypeConstraint": "A String", # Network type constraint.
                },
              ],
              "autoInstallMode": "A String", # The auto-install mode. If unset, defaults to "doNotAutoInstall". An app is automatically installed regardless of a set maintenance window.
              "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
              "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.
            },
            "autoUpdateMode": "A String", # The auto-update mode for the product. When autoUpdateMode is used, it always takes precedence over the user's choice. So when a user makes changes to the device settings manually, these changes are ignored.
            "enterpriseAuthenticationAppLinkConfigs": [ # An authentication URL configuration for the authenticator app of an identity provider. This helps to launch the identity provider's authenticator app during the authentication happening in a private app using Android WebView. Authenticator app should already be the default handler for the authentication url on the device.
              { # An authentication URL configuration for the authenticator app of an identity provider.
                "uri": "A String", # An authentication url.
              },
            ],
            "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.
              "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.
                "mcmId": "A String", # The ID of the managed configurations settings.
                "variableSet": [ # 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 '$' sign and should be alphanumeric only.
                    "placeholder": "A String", # The placeholder string; defined by EMM.
                    "userValue": "A String", # The value of the placeholder, specific to the user.
                  },
                ],
              },
              "kind": "A String", # Deprecated.
              "managedProperty": [ # 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's type in the app restrictions schema.
                  "key": "A String", # The unique key that identifies the property.
                  "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
                  "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
                    "managedProperty": [ # The list of managed properties.
                      # Object with schema name: ManagedProperty
                    ],
                  },
                  "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
                    { # A bundle of managed properties.
                      "managedProperty": [ # The list of managed properties.
                        # Object with schema name: ManagedProperty
                      ],
                    },
                  ],
                  "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
                  "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
                  "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
                    "A String",
                  ],
                },
              ],
              "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
            },
            "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
            "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.
              "A String",
            ],
            "tracks": [ # Deprecated. Use trackIds instead.
              "A String",
            ],
          },
        ],
      },
      "product": "A String", # The product name of the device. This comes from android.os.Build.PRODUCT.
      "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
        "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.
          { # List of states set by the app.
            "keyedAppState": [ # 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.
                "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.
                "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.
                "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.
                "severity": "A String", # Severity of the app state. This field will always be present.
                "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
              },
            ],
            "packageName": "A String", # The package name of the app. This field will always be present.
          },
        ],
        "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
      },
      "retailBrand": "A String", # Retail brand for the device, if set. See android.os.Build.BRAND
      "sdkVersion": 42, # API compatibility version.
    },
  ],
}
setState(enterpriseId, userId, deviceId, body=None, x__xgafv=None)
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.

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's device, as accessed by the getState and setState methods on device resources.
  "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.
}

  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's device, as accessed by the getState and setState methods on device resources.
  "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.
}
update(enterpriseId, userId, deviceId, body=None, updateMask=None, x__xgafv=None)
Updates the device policy. To ensure the policy is properly enforced, you need to prevent unmanaged accounts from accessing Google Play by setting the allowed_accounts in the managed configuration for the Google Play package. See restrict accounts in Google Play. When provisioning a new device, you should set the device policy using this method before adding the managed Google Play Account to the device, otherwise the policy will not be applied for a short period of time after adding the account to the 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)
  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.
  "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
  "device": "A String", # The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named "device" per logs/wireless/android/android_checkin.proto)
  "latestBuildFingerprint": "A String", # The build fingerprint of the device if known.
  "maker": "A String", # The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.
  "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. Possible values include: - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. - "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. - "containerApp", no longer used (deprecated). - "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.
  "model": "A String", # The model name of the device. This comes from android.os.Build.MODEL.
  "policy": { # The device policy for a given managed device. # The policy enforced on the device.
    "autoUpdatePolicy": "A String", # Controls when automatic app updates on the device can be applied. Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency. When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, autoUpdatePolicy has no effect. "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.
    "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
    "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.
      "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
      "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
    },
    "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.
    "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
      { # The policy for a product.
        "autoInstallPolicy": { # The auto-install policy for the product.
          "autoInstallConstraint": [ # 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.
              "chargingStateConstraint": "A String", # Charging state constraint.
              "deviceIdleStateConstraint": "A String", # Device idle state constraint.
              "networkTypeConstraint": "A String", # Network type constraint.
            },
          ],
          "autoInstallMode": "A String", # The auto-install mode. If unset, defaults to "doNotAutoInstall". An app is automatically installed regardless of a set maintenance window.
          "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
          "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.
        },
        "autoUpdateMode": "A String", # The auto-update mode for the product. When autoUpdateMode is used, it always takes precedence over the user's choice. So when a user makes changes to the device settings manually, these changes are ignored.
        "enterpriseAuthenticationAppLinkConfigs": [ # An authentication URL configuration for the authenticator app of an identity provider. This helps to launch the identity provider's authenticator app during the authentication happening in a private app using Android WebView. Authenticator app should already be the default handler for the authentication url on the device.
          { # An authentication URL configuration for the authenticator app of an identity provider.
            "uri": "A String", # An authentication url.
          },
        ],
        "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.
          "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.
            "mcmId": "A String", # The ID of the managed configurations settings.
            "variableSet": [ # 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 '$' sign and should be alphanumeric only.
                "placeholder": "A String", # The placeholder string; defined by EMM.
                "userValue": "A String", # The value of the placeholder, specific to the user.
              },
            ],
          },
          "kind": "A String", # Deprecated.
          "managedProperty": [ # 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's type in the app restrictions schema.
              "key": "A String", # The unique key that identifies the property.
              "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
              "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
                "managedProperty": [ # The list of managed properties.
                  # Object with schema name: ManagedProperty
                ],
              },
              "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
                { # A bundle of managed properties.
                  "managedProperty": [ # The list of managed properties.
                    # Object with schema name: ManagedProperty
                  ],
                },
              ],
              "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
              "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
              "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
                "A String",
              ],
            },
          ],
          "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
        },
        "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
        "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.
          "A String",
        ],
        "tracks": [ # Deprecated. Use trackIds instead.
          "A String",
        ],
      },
    ],
  },
  "product": "A String", # The product name of the device. This comes from android.os.Build.PRODUCT.
  "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
    "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.
      { # List of states set by the app.
        "keyedAppState": [ # 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.
            "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.
            "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.
            "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.
            "severity": "A String", # Severity of the app state. This field will always be present.
            "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
          },
        ],
        "packageName": "A String", # The package name of the app. This field will always be present.
      },
    ],
    "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
  },
  "retailBrand": "A String", # Retail brand for the device, if set. See android.os.Build.BRAND
  "sdkVersion": 42, # API compatibility version.
}

  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 updateMask=<field1>,<field2>,...
  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.
  "androidId": "A String", # The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0".
  "device": "A String", # The internal hardware codename of the device. This comes from android.os.Build.DEVICE. (field named "device" per logs/wireless/android/android_checkin.proto)
  "latestBuildFingerprint": "A String", # The build fingerprint of the device if known.
  "maker": "A String", # The manufacturer of the device. This comes from android.os.Build.MANUFACTURER.
  "managementType": "A String", # Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. Possible values include: - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. - "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. - "containerApp", no longer used (deprecated). - "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.
  "model": "A String", # The model name of the device. This comes from android.os.Build.MODEL.
  "policy": { # The device policy for a given managed device. # The policy enforced on the device.
    "autoUpdatePolicy": "A String", # Controls when automatic app updates on the device can be applied. Recommended alternative: autoUpdateMode which is set per app, provides greater flexibility around update frequency. When autoUpdateMode is set to AUTO_UPDATE_POSTPONED or AUTO_UPDATE_HIGH_PRIORITY, autoUpdatePolicy has no effect. "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.
    "deviceReportPolicy": "A String", # Whether the device reports app states to the EMM. The default value is "deviceReportDisabled".
    "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.
      "durationMs": "A String", # Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive).
      "startTimeAfterMidnightMs": "A String", # Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight.
    },
    "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.
    "productPolicy": [ # The list of product policies. The productAvailabilityPolicy needs to be set to WHITELIST or ALL for the product policies to be applied.
      { # The policy for a product.
        "autoInstallPolicy": { # The auto-install policy for the product.
          "autoInstallConstraint": [ # 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.
              "chargingStateConstraint": "A String", # Charging state constraint.
              "deviceIdleStateConstraint": "A String", # Device idle state constraint.
              "networkTypeConstraint": "A String", # Network type constraint.
            },
          ],
          "autoInstallMode": "A String", # The auto-install mode. If unset, defaults to "doNotAutoInstall". An app is automatically installed regardless of a set maintenance window.
          "autoInstallPriority": 42, # The priority of the install, as an unsigned integer. A lower number means higher priority.
          "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.
        },
        "autoUpdateMode": "A String", # The auto-update mode for the product. When autoUpdateMode is used, it always takes precedence over the user's choice. So when a user makes changes to the device settings manually, these changes are ignored.
        "enterpriseAuthenticationAppLinkConfigs": [ # An authentication URL configuration for the authenticator app of an identity provider. This helps to launch the identity provider's authenticator app during the authentication happening in a private app using Android WebView. Authenticator app should already be the default handler for the authentication url on the device.
          { # An authentication URL configuration for the authenticator app of an identity provider.
            "uri": "A String", # An authentication url.
          },
        ],
        "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.
          "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.
            "mcmId": "A String", # The ID of the managed configurations settings.
            "variableSet": [ # 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 '$' sign and should be alphanumeric only.
                "placeholder": "A String", # The placeholder string; defined by EMM.
                "userValue": "A String", # The value of the placeholder, specific to the user.
              },
            ],
          },
          "kind": "A String", # Deprecated.
          "managedProperty": [ # 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's type in the app restrictions schema.
              "key": "A String", # The unique key that identifies the property.
              "valueBool": True or False, # The boolean value - this will only be present if type of the property is bool.
              "valueBundle": { # A bundle of managed properties. # The bundle of managed properties - this will only be present if type of the property is bundle.
                "managedProperty": [ # The list of managed properties.
                  # Object with schema name: ManagedProperty
                ],
              },
              "valueBundleArray": [ # The list of bundles of properties - this will only be present if type of the property is bundle_array.
                { # A bundle of managed properties.
                  "managedProperty": [ # The list of managed properties.
                    # Object with schema name: ManagedProperty
                  ],
                },
              ],
              "valueInteger": 42, # The integer value - this will only be present if type of the property is integer.
              "valueString": "A String", # The string value - this will only be present if type of the property is string, choice or hidden.
              "valueStringArray": [ # The list of string values - this will only be present if type of the property is multiselect.
                "A String",
              ],
            },
          ],
          "productId": "A String", # The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm".
        },
        "productId": "A String", # The ID of the product. For example, "app:com.google.android.gm".
        "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.
          "A String",
        ],
        "tracks": [ # Deprecated. Use trackIds instead.
          "A String",
        ],
      },
    ],
  },
  "product": "A String", # The product name of the device. This comes from android.os.Build.PRODUCT.
  "report": { # Device report updated with the latest app states for managed apps on the device. # The device report updated with the latest app states.
    "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.
      { # List of states set by the app.
        "keyedAppState": [ # 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.
            "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.
            "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.
            "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.
            "severity": "A String", # Severity of the app state. This field will always be present.
            "stateTimestampMillis": "A String", # Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
          },
        ],
        "packageName": "A String", # The package name of the app. This field will always be present.
      },
    ],
    "lastUpdatedTimestampMillis": "A String", # The timestamp of the last report update in milliseconds since epoch. This field will always be present.
  },
  "retailBrand": "A String", # Retail brand for the device, if set. See android.os.Build.BRAND
  "sdkVersion": 42, # API compatibility version.
}