// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new PlannerUser
{
FavoritePlanReferences = new PlannerFavoritePlanReferenceCollection
{
AdditionalData = new Dictionary<string, object>
{
{
"jd8S5gOaFk2S8aWCIAJz42QAAxtD" , new PlannerFavoritePlanReference
{
OdataType = "#microsoft.graph.plannerFavoritePlanReference",
OrderHint = " !",
PlanTitle = "Next Release Discussion",
}
},
{
"7oTB5aMIAE2rVo-1N-L7RmQAGX2q" , null
},
},
},
RecentPlanReferences = new PlannerRecentPlanReferenceCollection
{
AdditionalData = new Dictionary<string, object>
{
{
"jd8S5gOaFk2S8aWCIAJz42QAAxtD" , new PlannerRecentPlanReference
{
OdataType = "#microsoft.graph.plannerRecentPlanReference",
LastAccessedDateTime = DateTimeOffset.Parse("2018-01-02T22:49:46.155Z"),
PlanTitle = "Next Release Discussion",
}
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Planner.PatchAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "return=representation");
requestConfiguration.Headers.Add("If-Match", "W/\"JzEtVXNlckRldGFpbHMgQEBAQEBAQEBAQEBAQEBIWCc=\"");
});
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
PlannerUser plannerUser = new PlannerUser();
PlannerFavoritePlanReferenceCollection favoritePlanReferences = new PlannerFavoritePlanReferenceCollection();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
PlannerFavoritePlanReference jd8S5gOaFk2S8aWCIAJz42QAAxtD = new PlannerFavoritePlanReference();
jd8S5gOaFk2S8aWCIAJz42QAAxtD.setOdataType("#microsoft.graph.plannerFavoritePlanReference");
jd8S5gOaFk2S8aWCIAJz42QAAxtD.setOrderHint(" !");
jd8S5gOaFk2S8aWCIAJz42QAAxtD.setPlanTitle("Next Release Discussion");
additionalData.put("jd8S5gOaFk2S8aWCIAJz42QAAxtD", jd8S5gOaFk2S8aWCIAJz42QAAxtD);
additionalData.put("7oTB5aMIAE2rVo-1N-L7RmQAGX2q", null);
favoritePlanReferences.setAdditionalData(additionalData);
plannerUser.setFavoritePlanReferences(favoritePlanReferences);
PlannerRecentPlanReferenceCollection recentPlanReferences = new PlannerRecentPlanReferenceCollection();
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
PlannerRecentPlanReference jd8S5gOaFk2S8aWCIAJz42QAAxtD1 = new PlannerRecentPlanReference();
jd8S5gOaFk2S8aWCIAJz42QAAxtD1.setOdataType("#microsoft.graph.plannerRecentPlanReference");
OffsetDateTime lastAccessedDateTime = OffsetDateTime.parse("2018-01-02T22:49:46.155Z");
jd8S5gOaFk2S8aWCIAJz42QAAxtD1.setLastAccessedDateTime(lastAccessedDateTime);
jd8S5gOaFk2S8aWCIAJz42QAAxtD1.setPlanTitle("Next Release Discussion");
additionalData1.put("jd8S5gOaFk2S8aWCIAJz42QAAxtD", jd8S5gOaFk2S8aWCIAJz42QAAxtD1);
recentPlanReferences.setAdditionalData(additionalData1);
plannerUser.setRecentPlanReferences(recentPlanReferences);
PlannerUser result = graphClient.me().planner().patch(plannerUser, requestConfiguration -> {
requestConfiguration.headers.add("Prefer", "return=representation");
requestConfiguration.headers.add("If-Match", "W/\"JzEtVXNlckRldGFpbHMgQEBAQEBAQEBAQEBAQEBIWCc=\"");
});
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\Item\Planner\PlannerRequestBuilderPatchRequestConfiguration;
use Microsoft\Graph\Generated\Models\PlannerUser;
use Microsoft\Graph\Generated\Models\PlannerFavoritePlanReferenceCollection;
use Microsoft\Graph\Generated\Models\PlannerFavoritePlanReference;
use Microsoft\Graph\Generated\Models\PlannerRecentPlanReferenceCollection;
use Microsoft\Graph\Generated\Models\PlannerRecentPlanReference;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PlannerUser();
$favoritePlanReferences = new PlannerFavoritePlanReferenceCollection();
$additionalData = [
'jd8S5gOaFk2S8aWCIAJz42QAAxtD' => [
'@odata.type' => '#microsoft.graph.plannerFavoritePlanReference',
'orderHint' => ' !',
'planTitle' => 'Next Release Discussion',
],
'7oTB5aMIAE2rVo-1N-L7RmQAGX2q' => null,
];
$favoritePlanReferences->setAdditionalData($additionalData);
$requestBody->setFavoritePlanReferences($favoritePlanReferences);
$recentPlanReferences = new PlannerRecentPlanReferenceCollection();
$additionalData = [
'jd8S5gOaFk2S8aWCIAJz42QAAxtD' => [
'@odata.type' => '#microsoft.graph.plannerRecentPlanReference',
'lastAccessedDateTime' => new \DateTime('2018-01-02T22:49:46.155Z'),
'planTitle' => 'Next Release Discussion',
],
];
$recentPlanReferences->setAdditionalData($additionalData);
$requestBody->setRecentPlanReferences($recentPlanReferences);
$requestConfiguration = new PlannerRequestBuilderPatchRequestConfiguration();
$headers = [
'Prefer' => 'return=representation',
'If-Match' => 'W/"JzEtVXNlckRldGFpbHMgQEBAQEBAQEBAQEBAQEBIWCc="',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->me()->planner()->patch($requestBody, $requestConfiguration)->wait();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。