attributeMappingSource 资源类型

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

定义应如何从源对象中提取值 (或转换) 。 例如,它可以是从源对象上的给定属性获取的值,也可以是基于多个源属性的字符串串联/提取/替换的更复杂的表达式。

属性

属性 类型 说明
表达式 String 此属性 MappingSource 对象的等效表达式表示形式。
name String 映射源的名称参数。 根据 类型 属性值,这可以是函数的名称、源属性的名称或要使用的常量值。
parameters stringKeyAttributeMappingSourceValuePair 集合 如果此对象表示函数,则列出函数参数。 参数由 attributeMappingSource 对象本身组成,允许使用复杂表达式。 如果 type 不是 Function,则此属性为 null/空数组。
type attributeMappingSourceType 此属性映射源的类型。 可取值为:AttributeConstantFunction。 默认值为“Attribute”。

示例语法

简单属性到属性映射。

{
    "expression": "[mail]",
    "name": "mail",
    "type": "Attribute"
}

从源属性中提取前八个字符的表达式。

 {
    "expression": "Mid([userPrincipalName], 1, 8)",
    "name": "Mid",
    "parameters": [
        {
            "key": "source",
            "value": {
                "expression": "[userPrincipalName]",
                "name": "userPrincipalName",
                "parameters": [],
                "type": "Attribute"
            }
        },
        {
            "key": "start",
            "value": {
                "expression": "\"1\"",
                "name": "1",
                "parameters": [],
                "type": "Constant"
            }
        },
        {
            "key": "length",
            "value": {
                "expression": "\"8\"",
                "name": "8",
                "parameters": [],
                "type": "Constant"
            }
        }
    ],
    "type": "Function"
}

JSON 表示形式

以下 JSON 表示形式显示了资源类型。

{
  "@odata.type": "#microsoft.graph.attributeMappingSource",
  "expression": "String",
  "name": "String",
  "parameters": [
    {
      "@odata.type": "microsoft.graph.stringKeyAttributeMappingSourceValuePair"
    }
  ],
  "type": "String"
}