attributeMappingSource 资源类型

命名空间:microsoft.graph

重要

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

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

属性

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

JSON 表示形式

下面是资源的 JSON 表示形式。

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

JSON 示例

简单属性到属性映射

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

从源属性提取前 8 个字符的表达式

 {
    "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"
}