# Google Play EMM API . enterprises

## Instance Methods

Deletes the binding between the MDM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call.

Enrolls an enterprise with the calling MDM.

Retrieves the name and domain of an enterprise.

Establishes the binding between the MDM and an enterprise. This is now deprecated; use enroll instead.

Looks up an enterprise by domain name.

Sends a test push notification to validate the MDM integration with the Google Cloud Pubsub service for this enterprise.

Set the account that will be used to authenticate to the API as the enterprise.

Unenrolls an enterprise from the calling MDM.

### Method Details

`delete(enterpriseId)`

    Deletes the binding between the MDM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call.

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

`enroll(token, body)`

    Enrolls an enterprise with the calling MDM.

    Args:
      token: string, The token provided by the enterprise to register the MDM. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # An enterprise resource represents a binding between an organisation and their MDM.
          #
          # To create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.
          #
          # After calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).
          #
          # The MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.
          #
          # The ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.
        "kind": "androidenterprise#enterprise", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise".
        "primaryDomain": "A String", # The enterprise's primary domain, e.g. "example.com".
        "id": "A String", # The unique ID for the enterprise.
        "name": "A String", # The name of the enterprise, e.g. "Example Inc".
      }

    Returns:
      An object of the form:

        { # An enterprise resource represents a binding between an organisation and their MDM.
            #
            # To create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.
            #
            # After calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).
            #
            # The MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.
            #
            # The ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.
          "kind": "androidenterprise#enterprise", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise".
          "primaryDomain": "A String", # The enterprise's primary domain, e.g. "example.com".
          "id": "A String", # The unique ID for the enterprise.
          "name": "A String", # The name of the enterprise, e.g. "Example Inc".
        }

`get(enterpriseId)`

    Retrieves the name and domain of an enterprise.

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

    Returns:
      An object of the form:

        { # An enterprise resource represents a binding between an organisation and their MDM.
            #
            # To create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.
            #
            # After calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).
            #
            # The MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.
            #
            # The ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.
          "kind": "androidenterprise#enterprise", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise".
          "primaryDomain": "A String", # The enterprise's primary domain, e.g. "example.com".
          "id": "A String", # The unique ID for the enterprise.
          "name": "A String", # The name of the enterprise, e.g. "Example Inc".
        }

`insert(token, body)`

    Establishes the binding between the MDM and an enterprise. This is now deprecated; use enroll instead.

    Args:
      token: string, The token provided by the enterprise to register the MDM. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # An enterprise resource represents a binding between an organisation and their MDM.
          #
          # To create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.
          #
          # After calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).
          #
          # The MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.
          #
          # The ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.
        "kind": "androidenterprise#enterprise", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise".
        "primaryDomain": "A String", # The enterprise's primary domain, e.g. "example.com".
        "id": "A String", # The unique ID for the enterprise.
        "name": "A String", # The name of the enterprise, e.g. "Example Inc".
      }

    Returns:
      An object of the form:

        { # An enterprise resource represents a binding between an organisation and their MDM.
            #
            # To create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.
            #
            # After calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).
            #
            # The MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.
            #
            # The ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.
          "kind": "androidenterprise#enterprise", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise".
          "primaryDomain": "A String", # The enterprise's primary domain, e.g. "example.com".
          "id": "A String", # The unique ID for the enterprise.
          "name": "A String", # The name of the enterprise, e.g. "Example Inc".
        }

`list(domain)`

    Looks up an enterprise by domain name.

    Args:
      domain: string, The exact primary domain name of the enterprise to look up. (required)

    Returns:
      An object of the form:

        { # The matching enterprise resources.
        "kind": "androidenterprise#enterprisesListResponse", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprisesListResponse".
        "enterprise": [ # An enterprise.
          { # An enterprise resource represents a binding between an organisation and their MDM.
                #
                # To create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.
                #
                # After calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).
                #
                # The MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.
                #
                # The ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.
              "kind": "androidenterprise#enterprise", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise".
              "primaryDomain": "A String", # The enterprise's primary domain, e.g. "example.com".
              "id": "A String", # The unique ID for the enterprise.
              "name": "A String", # The name of the enterprise, e.g. "Example Inc".
            },
        ],
      }

`sendTestPushNotification(enterpriseId)`

    Sends a test push notification to validate the MDM integration with the Google Cloud Pubsub service for this enterprise.

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

    Returns:
      An object of the form:

        {
        "topicName": "A String", # The name of the Cloud Pubsub topic to which notifications for this enterprise's enrolled account will be sent.
        "messageId": "A String", # The message ID of the test push notification that was sent.
      }

`setAccount(enterpriseId, body)`

    Set the account that will be used to authenticate to the API as the enterprise.

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

    { # A service account that can be used to authenticate as the enterprise to API calls that require such authentication.
        "kind": "androidenterprise#enterpriseAccount", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterpriseAccount".
        "accountEmail": "A String", # The email address of the service account.
      }

    Returns:
      An object of the form:

        { # A service account that can be used to authenticate as the enterprise to API calls that require such authentication.
          "kind": "androidenterprise#enterpriseAccount", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterpriseAccount".
          "accountEmail": "A String", # The email address of the service account.
        }

`unenroll(enterpriseId)`

    Unenrolls an enterprise from the calling MDM.

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