Products: getAppRestrictionsSchema

检索定义此商品的可配置属性的架构。所有产品都有架构,但如果未定义托管配置,此架构可能为空。此架构可用于填充供管理员配置产品的界面。如需根据使用此 API 获取的架构应用托管配置,请参阅通过 Play 获取托管配置

请求

HTTP 请求

GET https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/products/productId/appRestrictionsSchema

参数

参数名称 价值 说明
路径参数
enterpriseId string 企业的 ID。
productId string 商品的 ID。
可选的查询参数
language string 用户首选语言的 BCP47 标记(例如“en-US”“de”)。

授权

此请求需要获得以下范围的授权:

范围
https://www.googleapis.com/auth/androidenterprise

如需了解详情,请参阅身份验证和授权页面。

请求正文

使用此方法时请勿提供请求正文。

响应

如果成功,此方法将返回采用以下结构的响应正文:

{
  "kind": string,
  "restrictions": [
    {
      "key": string,
      "title": string,
      "restrictionType": string,
      "description": string,
      "entry": [
        string
      ],
      "entryValue": [
        string
      ],
      "defaultValue": {
        "type": string,
        "valueBool": boolean,
        "valueString": string,
        "valueInteger": integer,
        "valueMultiselect": [
          string
        ]
      },
      "nestedRestriction": [
        (AppRestrictionsSchemaRestriction)
      ]
    }
  ]
}
属性名称 价值 说明 备注
restrictions[] list 构成此架构的一组限制。
restrictions[].key string 产品用于标识限制的唯一密钥,例如“com.google.android.gm.fieldname”。
restrictions[].title string 限制的名称。
restrictions[].restrictionType string 限制的类型。

可接受的值:
  • "bool"
  • "bundle"
  • "bundleArray"
  • "choice"
  • "hidden"
  • "integer"
  • "multiselect"
  • "string"
restrictions[].description string 对限制的较长说明,详细说明其影响。
restrictions[].entry[] list 对于 choicemultiselect 限制,此字段是可能的条目的直观易懂的名称列表。
restrictions[].entryValue[] list 对于 choicemultiselect 限制,此字段是可能条目的机器可读值的列表。这些值应在配置中使用,要么作为单个 string 值(对于 choice 限制)或 stringArray(对于 multiselect 限制)使用。
restrictions[].defaultValue nested object 限制的默认值。bundlebundleArray 限制从不会有默认值。
restrictions[].defaultValue.type string 所提供值的类型。

可接受的值:
  • "bool"
  • "bundle"
  • "bundleArray"
  • "choice"
  • "hidden"
  • "integer"
  • "multiselect"
  • "string"
restrictions[].defaultValue.valueBool boolean 布尔值 - 仅当类型为 bool 时才会显示。
restrictions[].defaultValue.valueString string 字符串值 - 将针对字符串、选择和隐藏类型显示。
restrictions[].defaultValue.valueInteger integer 整数值 - 仅当类型为整数时才存在。
restrictions[].defaultValue.valueMultiselect[] list 字符串值列表 - 仅当类型为多选时才会显示。
restrictions[].nestedRestriction[] list 对于 bundlebundleArray 限制,嵌套限制列表。bundle 限制始终嵌套在 bundleArray 限制中,bundleArray 限制最多嵌套两层。
kind string 已弃用。