# Google Play MDM API . collections

## Instance Methods

Deletes a collection.

Retrieves the details of a collection.

Creates a new collection.

Retrieves the IDs of all the collections for an enterprise.

Updates a collection. This method supports patch semantics.

Updates a collection.

### Method Details

`delete(enterpriseId, collectionId)`

    Deletes a collection.

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

`get(enterpriseId, collectionId)`

    Retrieves the details of a collection.

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

    Returns:
      An object of the form:

        { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
            #
            # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
          "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
          "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
            "A String",
          ],
          "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
          "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
          "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
        }

`insert(enterpriseId, body)`

    Creates a new collection.

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

    { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
          #
          # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
        "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
        "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
          "A String",
        ],
        "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
        "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
        "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
      }

    Returns:
      An object of the form:

        { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
            #
            # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
          "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
          "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
            "A String",
          ],
          "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
          "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
          "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
        }

`list(enterpriseId)`

    Retrieves the IDs of all the collections for an enterprise.

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

    Returns:
      An object of the form:

        { # The collection resources for the enterprise.
        "kind": "androidenterprise#collectionsListResponse", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collectionsListResponse".
        "collection": [ # An ordered collection of products which can be made visible on the Google Play Store app to a selected group of users.
          { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
                #
                # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
              "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
              "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
                "A String",
              ],
              "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
              "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
              "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
            },
        ],
      }

`patch(enterpriseId, collectionId, body)`

    Updates a collection. This method supports patch semantics.

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

    { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
          #
          # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
        "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
        "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
          "A String",
        ],
        "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
        "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
        "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
      }

    Returns:
      An object of the form:

        { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
            #
            # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
          "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
          "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
            "A String",
          ],
          "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
          "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
          "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
        }

`update(enterpriseId, collectionId, body)`

    Updates a collection.

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

    { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
          #
          # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
        "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
        "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
          "A String",
        ],
        "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
        "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
        "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
      }

    Returns:
      An object of the form:

        { # A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.
            #
            # Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.
          "kind": "androidenterprise#collection", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection".
          "productId": [ # The IDs of the products in the collection, in the order in which they should be displayed.
            "A String",
          ],
          "name": "A String", # A user-friendly name for the collection (should be unique), e.g. "Accounting apps".
          "visibility": "A String", # Whether this collection is visible to all users, or only to the users that have been granted access through the collection_viewers api. Even if a collection is visible to allUsers, it is possible to add and remove viewers, but this will have no effect until the collection's visibility changes to viewersOnly.
          "collectionId": "A String", # Arbitrary unique ID, allocated by the API on creation.
        }