# Google Play EMM API . products

## Instance Methods

Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000.

Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.

Retrieves details of a product for display to an enterprise admin.

Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined.

Retrieves the Android app permissions required by this app.

Finds approved products that match a query.

This method has been deprecated. To programmatically approve applications, you must use the iframe mechanism via the generateApprovalUrl and approve methods of the Products resource. For more information, see the Play EMM API usage requirements.

### Method Details

`approve(enterpriseId, productId, body)`

    Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000.

    To learn how to use Google Play for Work to design and create a store layout to display approved products to your users, see Store Layout Design.

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

    {
        "approvalUrlInfo": { # Information on an approval URL. # The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new permissions if the product was updated since the URL was generated.
          "kind": "androidenterprise#approvalUrlInfo", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo".
          "approvalUrl": "A String", # A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call.
        },
      }

`generateApprovalUrl(enterpriseId, productId, languageCode=None)`

    Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.

    Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      productId: string, The ID of the product. (required)
      languageCode: string, The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US".

    Returns:
      An object of the form:

        {
        "url": "A String", # A URL that can be rendered in an iframe to display the permissions (if any) of a product. This URL can be used to approve the product only once and only within 24 hours of being generated, using the Products.approve call. If the product is currently unapproved and has no permissions, this URL will point to an empty page. If the product is currently approved, a URL will only be generated if that product has added permissions since it was last approved, and the URL will only display those new permissions that have not yet been accepted.
      }

`get(enterpriseId, productId, language=None)`

    Retrieves details of a product for display to an enterprise admin.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      productId: string, The ID of the product, e.g. "app:com.google.android.gm". (required)
      language: string, The BCP47 tag for the user's preferred language (e.g. "en-US", "de").

    Returns:
      An object of the form:

        { # A product represents an app in the Google Play Store that is available to at least some users in the enterprise. (Some apps are restricted to a single enterprise, and no information about them is made available outside that enterprise.)
          #
          # The information provided for each product (localized name, icon, link to the full Google Play details page) is intended to allow a basic representation of the product within an EMM user interface.
        "smallIconUrl": "A String", # A link to a smaller image that can be used as an icon for the product. This image is suitable for use at up to 128px x 128px.
        "kind": "androidenterprise#product", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product".
        "distributionChannel": "A String", # How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play Store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted.
        "title": "A String", # The name of the product.
        "workDetailsUrl": "A String", # A link to the Google Play for Work details page for the product, for use by an Enterprise administrator.
        "appVersion": [ # App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included.
          { # This represents a single version of the app.
            "versionCode": 42, # Unique increasing identifier for the app version.
            "versionString": "A String", # The string used in the Play Store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be "1.4").
          },
        ],
        "productPricing": "A String", # Whether this product is free, free with in-app purchases, or paid.
        "iconUrl": "A String", # A link to an image that can be used as an icon for the product. This image is suitable for use at up to 512px x 512px.
        "authorName": "A String", # The name of the author of the product (e.g. the app developer).
        "requiresContainerApp": True or False, # Whether this app can only be installed on devices using the Android for Work container app.
        "detailsUrl": "A String", # A link to the (consumer) Google Play details page for the product.
        "productId": "A String", # A string of the form app:. For example, app:com.google.android.gm represents the Gmail app.
      }

`getAppRestrictionsSchema(enterpriseId, productId, language=None)`

    Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      productId: string, The ID of the product. (required)
      language: string, The BCP47 tag for the user's preferred language (e.g. "en-US", "de").

    Returns:
      An object of the form:

        { # Represents the list of app restrictions available to be pre-configured for the product.
        "restrictions": [ # The set of restrictions that make up this schema.
          { # A restriction in the App Restriction Schema represents a piece of configuration that may be pre-applied.
            "restrictionType": "A String", # The type of the restriction.
            "title": "A String", # The name of the restriction.
            "defaultValue": { # A typed value for the restriction. # The default value of the restriction.
              "valueBool": True or False, # The boolean value - this will only be present if type is bool.
              "valueString": "A String", # The string value - this will be present for types string, choice and hidden.
              "type": "A String", # The type of the value being provided.
              "valueMultiselect": [ # The list of string values - this will only be present if type is multiselect.
                "A String",
              ],
              "valueInteger": 42, # The integer value - this will only be present if type is integer.
            },
            "entryValue": [ # For choice or multiselect restrictions, the list of possible entries' machine-readable values.
              "A String",
            ],
            "key": "A String", # The unique key that the product uses to identify the restriction, e.g. "com.google.android.gm.fieldname".
            "entry": [ # For choice or multiselect restrictions, the list of possible entries' human-readable names.
              "A String",
            ],
            "description": "A String", # A longer description of the restriction, giving more detail of what it affects.
          },
        ],
        "kind": "androidenterprise#appRestrictionsSchema", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#appRestrictionsSchema".
      }

`getPermissions(enterpriseId, productId)`

    Retrieves the Android app permissions required by this app.

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

    Returns:
      An object of the form:

        { # Information about the permissions required by a specific app and whether they have been accepted by the enterprise.
          "kind": "androidenterprise#productPermissions", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions".
          "productId": "A String", # The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm".
          "permission": [ # The permissions required by the app.
            { # A product permissions resource represents the set of permissions required by a specific app and whether or not they have been accepted by an enterprise admin.
                #
                # The API can be used to read the set of permissions, and also to update the set to indicate that permissions have been accepted.
              "permissionId": "A String", # An opaque string uniquely identifying the permission.
              "state": "A String", # Whether the permission has been accepted or not.
            },
          ],
        }

`list(enterpriseId, language=None, maxResults=None, token=None, query=None, approved=None)`

    Finds approved products that match a query.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      language: string, The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language.
      maxResults: integer, Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum retrievable within a single response.
      token: string, A pagination token is contained in a requests response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request.
      query: string, The search query as typed in the Google Play Store search box. If omitted, all approved apps will be returned (using the pagination parameters).
      approved: boolean, Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be specified.

    Returns:
      An object of the form:

        { # The matching products.
        "product": [ # Information about a product (e.g. an app) in the Google Play Store, for display to an enterprise admin.
          { # A product represents an app in the Google Play Store that is available to at least some users in the enterprise. (Some apps are restricted to a single enterprise, and no information about them is made available outside that enterprise.)
              #
              # The information provided for each product (localized name, icon, link to the full Google Play details page) is intended to allow a basic representation of the product within an EMM user interface.
            "smallIconUrl": "A String", # A link to a smaller image that can be used as an icon for the product. This image is suitable for use at up to 128px x 128px.
            "kind": "androidenterprise#product", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product".
            "distributionChannel": "A String", # How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play Store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted.
            "title": "A String", # The name of the product.
            "workDetailsUrl": "A String", # A link to the Google Play for Work details page for the product, for use by an Enterprise administrator.
            "appVersion": [ # App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included.
              { # This represents a single version of the app.
                "versionCode": 42, # Unique increasing identifier for the app version.
                "versionString": "A String", # The string used in the Play Store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be "1.4").
              },
            ],
            "productPricing": "A String", # Whether this product is free, free with in-app purchases, or paid.
            "iconUrl": "A String", # A link to an image that can be used as an icon for the product. This image is suitable for use at up to 512px x 512px.
            "authorName": "A String", # The name of the author of the product (e.g. the app developer).
            "requiresContainerApp": True or False, # Whether this app can only be installed on devices using the Android for Work container app.
            "detailsUrl": "A String", # A link to the (consumer) Google Play details page for the product.
            "productId": "A String", # A string of the form app:. For example, app:com.google.android.gm represents the Gmail app.
          },
        ],
        "kind": "androidenterprise#productsListResponse", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productsListResponse".
        "tokenPagination": { # Pagination information for token pagination.
          "nextPageToken": "A String",
          "previousPageToken": "A String",
        },
        "pageInfo": { # General pagination information.
          "totalResults": 42,
          "startIndex": 42,
          "resultPerPage": 42,
        },
      }

`updatePermissions(enterpriseId, productId, body)`

    This method has been deprecated. To programmatically approve applications, you must use the iframe mechanism via the  generateApprovalUrl and  approve methods of the Products resource. For more information, see the  Play EMM API usage requirements.

    The updatePermissions method (deprecated) updates the set of Android app permissions for this app that have been accepted by the enterprise.

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

    { # Information about the permissions required by a specific app and whether they have been accepted by the enterprise.
        "kind": "androidenterprise#productPermissions", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions".
        "productId": "A String", # The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm".
        "permission": [ # The permissions required by the app.
          { # A product permissions resource represents the set of permissions required by a specific app and whether or not they have been accepted by an enterprise admin.
              #
              # The API can be used to read the set of permissions, and also to update the set to indicate that permissions have been accepted.
            "permissionId": "A String", # An opaque string uniquely identifying the permission.
            "state": "A String", # Whether the permission has been accepted or not.
          },
        ],
      }

    Returns:
      An object of the form:

        { # Information about the permissions required by a specific app and whether they have been accepted by the enterprise.
          "kind": "androidenterprise#productPermissions", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions".
          "productId": "A String", # The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm".
          "permission": [ # The permissions required by the app.
            { # A product permissions resource represents the set of permissions required by a specific app and whether or not they have been accepted by an enterprise admin.
                #
                # The API can be used to read the set of permissions, and also to update the set to indicate that permissions have been accepted.
              "permissionId": "A String", # An opaque string uniquely identifying the permission.
              "state": "A String", # Whether the permission has been accepted or not.
            },
          ],
        }