# Google Play EMM API . users

## Instance Methods

Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.

Retrieves a user's details.

Retrieves the set of products a user is entitled to access.

Looks up a user by their primary email address.

Revokes a previously generated token (activation code) for the user.

Modifies the set of products a user is entitled to access.

### Method Details

`generateToken(enterpriseId, userId)`

    Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.

    This call only works with Google managed accounts.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)

    Returns:
      An object of the form:

        { # A UserToken is used by a user when setting up a managed device or profile with their work account on a device. When the user enters their email address and token (activation code) the appropriate EMM app can be automatically downloaded.
        "kind": "androidenterprise#userToken", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken".
        "userId": "A String", # The unique ID for the user.
        "token": "A String", # The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0.
      }

`get(enterpriseId, userId)`

    Retrieves a user's details.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)

    Returns:
      An object of the form:

        { # A user resource represents an individual user within the enterprise's domain.
            #
            # Note that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing the EMM's DPC app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API.
            #
            # The ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address.
          "kind": "androidenterprise#user", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user".
          "primaryEmail": "A String", # The user's primary email, e.g. "jsmith@example.com". Will always be set for Google managed users and not set for EMM managed users.
          "id": "A String", # The unique ID for the user.
        }

`getAvailableProductSet(enterpriseId, userId)`

    Retrieves the set of products a user is entitled to access.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)

    Returns:
      An object of the form:

        { # A set of products.
          "kind": "androidenterprise#productSet", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet".
          "productId": [ # The list of product IDs making up the set of products.
            "A String",
          ],
        }

`list(enterpriseId, email)`

    Looks up a user by their primary email address.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      email: string, The exact primary email address of the user to look up. (required)

    Returns:
      An object of the form:

        { # The matching user resources.
        "kind": "androidenterprise#usersListResponse", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#usersListResponse".
        "user": [ # A user of an enterprise.
          { # A user resource represents an individual user within the enterprise's domain.
                #
                # Note that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing the EMM's DPC app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API.
                #
                # The ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address.
              "kind": "androidenterprise#user", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user".
              "primaryEmail": "A String", # The user's primary email, e.g. "jsmith@example.com". Will always be set for Google managed users and not set for EMM managed users.
              "id": "A String", # The unique ID for the user.
            },
        ],
      }

`revokeToken(enterpriseId, userId)`

    Revokes a previously generated token (activation code) for the user.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)

`setAvailableProductSet(enterpriseId, userId, body)`

    Modifies the set of products a user is entitled to access.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # A set of products.
        "kind": "androidenterprise#productSet", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet".
        "productId": [ # The list of product IDs making up the set of products.
          "A String",
        ],
      }

    Returns:
      An object of the form:

        { # A set of products.
          "kind": "androidenterprise#productSet", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet".
          "productId": [ # The list of product IDs making up the set of products.
            "A String",
          ],
        }