# Google Play EMM API . enterprises

## Instance Methods

Deletes the binding between the EMM 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 EMM.

Retrieves the name and domain of an enterprise.

Returns the store layout resource.

Establishes the binding between the EMM 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 EMM integration with the Google Cloud Pub/Sub service for this enterprise.

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

Sets the store layout resource.

Unenrolls an enterprise from the calling EMM.

### Method Details

`delete(enterpriseId)`

    Deletes the binding between the EMM 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 EMM.

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

    { # An enterprise resource represents a binding between an organisation and their EMM.
          #
          # 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 EMM, who then supplies it to the enroll method. Until this is done the EMM will not have any access to the enterprise.
          #
          # After calling enroll the EMM 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 EMM 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 EMM'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 EMM.
            #
            # 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 EMM, who then supplies it to the enroll method. Until this is done the EMM will not have any access to the enterprise.
            #
            # After calling enroll the EMM 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 EMM 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 EMM'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 EMM.
            #
            # 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 EMM, who then supplies it to the enroll method. Until this is done the EMM will not have any access to the enterprise.
            #
            # After calling enroll the EMM 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 EMM 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 EMM'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".
        }

`getStoreLayout(enterpriseId)`

    Returns the store layout resource.

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

    Returns:
      An object of the form:

        { # General setting for the Google Play for Work store layout, currently only specifying the page to display the first time the store is opened.
        "homepageId": "A String", # The ID of the store page to be used as the homepage. The homepage will be used as the first page shown in the Google Play for Work store.
            #
            # If there is no homepage set, an empty store is shown. The homepage can be unset (by not specifying it) to empty the store.
            #
            # If there exists at least one page, this field must be set to the ID of a valid page.
        "kind": "androidenterprise#storeLayout", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout".
      }

`insert(token, body)`

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

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

    { # An enterprise resource represents a binding between an organisation and their EMM.
          #
          # 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 EMM, who then supplies it to the enroll method. Until this is done the EMM will not have any access to the enterprise.
          #
          # After calling enroll the EMM 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 EMM 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 EMM'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 EMM.
            #
            # 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 EMM, who then supplies it to the enroll method. Until this is done the EMM will not have any access to the enterprise.
            #
            # After calling enroll the EMM 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 EMM 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 EMM'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 EMM.
                #
                # 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 EMM, who then supplies it to the enroll method. Until this is done the EMM will not have any access to the enterprise.
                #
                # After calling enroll the EMM 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 EMM 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 EMM'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 EMM integration with the Google Cloud Pub/Sub 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 Pub/Sub 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.
        }

`setStoreLayout(enterpriseId, body)`

    Sets the store layout resource.

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

    { # General setting for the Google Play for Work store layout, currently only specifying the page to display the first time the store is opened.
      "homepageId": "A String", # The ID of the store page to be used as the homepage. The homepage will be used as the first page shown in the Google Play for Work store.
          #
          # If there is no homepage set, an empty store is shown. The homepage can be unset (by not specifying it) to empty the store.
          #
          # If there exists at least one page, this field must be set to the ID of a valid page.
      "kind": "androidenterprise#storeLayout", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout".
    }

    Returns:
      An object of the form:

        { # General setting for the Google Play for Work store layout, currently only specifying the page to display the first time the store is opened.
        "homepageId": "A String", # The ID of the store page to be used as the homepage. The homepage will be used as the first page shown in the Google Play for Work store.
            #
            # If there is no homepage set, an empty store is shown. The homepage can be unset (by not specifying it) to empty the store.
            #
            # If there exists at least one page, this field must be set to the ID of a valid page.
        "kind": "androidenterprise#storeLayout", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout".
      }

`unenroll(enterpriseId)`

    Unenrolls an enterprise from the calling EMM.

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