As APIs na versão /beta no Microsoft Graph estão sujeitas a alterações. Não há suporte para o uso dessas APIs em aplicativos de produção. Para determinar se uma API está disponível na v1.0, use o seletor Versão.
Escolha a permissão ou as permissões marcadas como menos privilegiadas para essa API. Use uma permissão ou permissões privilegiadas mais altas somente se o aplicativo exigir. Para obter detalhes sobre permissões delegadas e de aplicativo, consulte Tipos de permissão. Para saber mais sobre essas permissões, consulte a referência de permissões.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.IndustryData;
var requestBody = new SourceSystemDefinition
{
DisplayName = "Rostering source",
UserMatchingSettings = new List<UserMatchingSetting>
{
new UserMatchingSetting
{
MatchTarget = new UserMatchTargetReferenceValue
{
Code = "userPrincipalName",
},
PriorityOrder = 0,
SourceIdentifier = new IdentifierTypeReferenceValue
{
Code = "username",
},
AdditionalData = new Dictionary<string, object>
{
{
"roleGroup@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/roleGroups/staff"
},
},
},
new UserMatchingSetting
{
MatchTarget = new UserMatchTargetReferenceValue
{
Code = "userPrincipalName",
},
PriorityOrder = 1,
SourceIdentifier = new IdentifierTypeReferenceValue
{
Code = "username",
},
AdditionalData = new Dictionary<string, object>
{
{
"roleGroup@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/roleGroups('students')"
},
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.IndustryData.SourceSystems.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsindustrydata "github.com/microsoftgraph/msgraph-beta-sdk-go/models/industrydata"
//other-imports
)
requestBody := graphmodelsindustrydata.NewSourceSystemDefinition()
displayName := "Rostering source"
requestBody.SetDisplayName(&displayName)
userMatchingSetting := graphmodelsindustrydata.NewUserMatchingSetting()
matchTarget := graphmodelsindustrydata.NewUserMatchTargetReferenceValue()
code := "userPrincipalName"
matchTarget.SetCode(&code)
userMatchingSetting.SetMatchTarget(matchTarget)
priorityOrder := int32(0)
userMatchingSetting.SetPriorityOrder(&priorityOrder)
sourceIdentifier := graphmodelsindustrydata.NewIdentifierTypeReferenceValue()
code := "username"
sourceIdentifier.SetCode(&code)
userMatchingSetting.SetSourceIdentifier(sourceIdentifier)
additionalData := map[string]interface{}{
"roleGroup@odata.bind" : "https://graph.microsoft.com/beta/external/industryData/roleGroups/staff",
}
userMatchingSetting.SetAdditionalData(additionalData)
userMatchingSetting1 := graphmodelsindustrydata.NewUserMatchingSetting()
matchTarget := graphmodelsindustrydata.NewUserMatchTargetReferenceValue()
code := "userPrincipalName"
matchTarget.SetCode(&code)
userMatchingSetting1.SetMatchTarget(matchTarget)
priorityOrder := int32(1)
userMatchingSetting1.SetPriorityOrder(&priorityOrder)
sourceIdentifier := graphmodelsindustrydata.NewIdentifierTypeReferenceValue()
code := "username"
sourceIdentifier.SetCode(&code)
userMatchingSetting1.SetSourceIdentifier(sourceIdentifier)
additionalData := map[string]interface{}{
"roleGroup@odata.bind" : "https://graph.microsoft.com/beta/external/industryData/roleGroups('students')",
}
userMatchingSetting1.SetAdditionalData(additionalData)
userMatchingSettings := []graphmodelsindustrydata.UserMatchingSettingable {
userMatchingSetting,
userMatchingSetting1,
}
requestBody.SetUserMatchingSettings(userMatchingSettings)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
sourceSystems, err := graphClient.External().IndustryData().SourceSystems().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.industrydata.SourceSystemDefinition sourceSystemDefinition = new com.microsoft.graph.beta.models.industrydata.SourceSystemDefinition();
sourceSystemDefinition.setDisplayName("Rostering source");
LinkedList<com.microsoft.graph.beta.models.industrydata.UserMatchingSetting> userMatchingSettings = new LinkedList<com.microsoft.graph.beta.models.industrydata.UserMatchingSetting>();
com.microsoft.graph.beta.models.industrydata.UserMatchingSetting userMatchingSetting = new com.microsoft.graph.beta.models.industrydata.UserMatchingSetting();
com.microsoft.graph.beta.models.industrydata.UserMatchTargetReferenceValue matchTarget = new com.microsoft.graph.beta.models.industrydata.UserMatchTargetReferenceValue();
matchTarget.setCode("userPrincipalName");
userMatchingSetting.setMatchTarget(matchTarget);
userMatchingSetting.setPriorityOrder(0);
com.microsoft.graph.beta.models.industrydata.IdentifierTypeReferenceValue sourceIdentifier = new com.microsoft.graph.beta.models.industrydata.IdentifierTypeReferenceValue();
sourceIdentifier.setCode("username");
userMatchingSetting.setSourceIdentifier(sourceIdentifier);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("roleGroup@odata.bind", "https://graph.microsoft.com/beta/external/industryData/roleGroups/staff");
userMatchingSetting.setAdditionalData(additionalData);
userMatchingSettings.add(userMatchingSetting);
com.microsoft.graph.beta.models.industrydata.UserMatchingSetting userMatchingSetting1 = new com.microsoft.graph.beta.models.industrydata.UserMatchingSetting();
com.microsoft.graph.beta.models.industrydata.UserMatchTargetReferenceValue matchTarget1 = new com.microsoft.graph.beta.models.industrydata.UserMatchTargetReferenceValue();
matchTarget1.setCode("userPrincipalName");
userMatchingSetting1.setMatchTarget(matchTarget1);
userMatchingSetting1.setPriorityOrder(1);
com.microsoft.graph.beta.models.industrydata.IdentifierTypeReferenceValue sourceIdentifier1 = new com.microsoft.graph.beta.models.industrydata.IdentifierTypeReferenceValue();
sourceIdentifier1.setCode("username");
userMatchingSetting1.setSourceIdentifier(sourceIdentifier1);
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("roleGroup@odata.bind", "https://graph.microsoft.com/beta/external/industryData/roleGroups('students')");
userMatchingSetting1.setAdditionalData(additionalData1);
userMatchingSettings.add(userMatchingSetting1);
sourceSystemDefinition.setUserMatchingSettings(userMatchingSettings);
com.microsoft.graph.models.industrydata.SourceSystemDefinition result = graphClient.external().industryData().sourceSystems().post(sourceSystemDefinition);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\SourceSystemDefinition;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\UserMatchingSetting;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\UserMatchTargetReferenceValue;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\IdentifierTypeReferenceValue;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SourceSystemDefinition();
$requestBody->setDisplayName('Rostering source');
$userMatchingSettingsUserMatchingSetting1 = new UserMatchingSetting();
$userMatchingSettingsUserMatchingSetting1MatchTarget = new UserMatchTargetReferenceValue();
$userMatchingSettingsUserMatchingSetting1MatchTarget->setCode('userPrincipalName');
$userMatchingSettingsUserMatchingSetting1->setMatchTarget($userMatchingSettingsUserMatchingSetting1MatchTarget);
$userMatchingSettingsUserMatchingSetting1->setPriorityOrder(0);
$userMatchingSettingsUserMatchingSetting1SourceIdentifier = new IdentifierTypeReferenceValue();
$userMatchingSettingsUserMatchingSetting1SourceIdentifier->setCode('username');
$userMatchingSettingsUserMatchingSetting1->setSourceIdentifier($userMatchingSettingsUserMatchingSetting1SourceIdentifier);
$additionalData = [
'roleGroup@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/roleGroups/staff',
];
$userMatchingSettingsUserMatchingSetting1->setAdditionalData($additionalData);
$userMatchingSettingsArray []= $userMatchingSettingsUserMatchingSetting1;
$userMatchingSettingsUserMatchingSetting2 = new UserMatchingSetting();
$userMatchingSettingsUserMatchingSetting2MatchTarget = new UserMatchTargetReferenceValue();
$userMatchingSettingsUserMatchingSetting2MatchTarget->setCode('userPrincipalName');
$userMatchingSettingsUserMatchingSetting2->setMatchTarget($userMatchingSettingsUserMatchingSetting2MatchTarget);
$userMatchingSettingsUserMatchingSetting2->setPriorityOrder(1);
$userMatchingSettingsUserMatchingSetting2SourceIdentifier = new IdentifierTypeReferenceValue();
$userMatchingSettingsUserMatchingSetting2SourceIdentifier->setCode('username');
$userMatchingSettingsUserMatchingSetting2->setSourceIdentifier($userMatchingSettingsUserMatchingSetting2SourceIdentifier);
$additionalData = [
'roleGroup@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/roleGroups(\'students\')',
];
$userMatchingSettingsUserMatchingSetting2->setAdditionalData($additionalData);
$userMatchingSettingsArray []= $userMatchingSettingsUserMatchingSetting2;
$requestBody->setUserMatchingSettings($userMatchingSettingsArray);
$result = $graphServiceClient->external()->industryData()->sourceSystems()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.industry_data.source_system_definition import SourceSystemDefinition
from msgraph_beta.generated.models.industry_data.user_matching_setting import UserMatchingSetting
from msgraph_beta.generated.models.industry_data.user_match_target_reference_value import UserMatchTargetReferenceValue
from msgraph_beta.generated.models.industry_data.identifier_type_reference_value import IdentifierTypeReferenceValue
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SourceSystemDefinition(
display_name = "Rostering source",
user_matching_settings = [
UserMatchingSetting(
match_target = UserMatchTargetReferenceValue(
code = "userPrincipalName",
),
priority_order = 0,
source_identifier = IdentifierTypeReferenceValue(
code = "username",
),
additional_data = {
"role_group@odata_bind" : "https://graph.microsoft.com/beta/external/industryData/roleGroups/staff",
}
),
UserMatchingSetting(
match_target = UserMatchTargetReferenceValue(
code = "userPrincipalName",
),
priority_order = 1,
source_identifier = IdentifierTypeReferenceValue(
code = "username",
),
additional_data = {
"role_group@odata_bind" : "https://graph.microsoft.com/beta/external/industryData/roleGroups('students')",
}
),
],
)
result = await graph_client.external.industry_data.source_systems.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.