Dans le corps de la demande, fournissez uniquement les valeurs des propriétés à mettre à jour. Les propriétés existantes qui ne sont pas incluses dans le corps de la demande conservent leurs valeurs précédentes ou sont recalculées en fonction des modifications apportées à d’autres valeurs de propriété.
Le tableau suivant spécifie les propriétés qui peuvent être mises à jour.
Pour supprimer un artefact de restauration de lecteur, spécifiez l’annotation @removed dans le corps de la demande avec l’ID de l’objet driveRestoreArtifact .
Réponse
Si elle réussit, cette méthode renvoie un 200 OK code de réponse et un objet oneDriveForBusinessRestoreSession mis à jour dans le corps de la réponse.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new OneDriveForBusinessRestoreSession
{
AdditionalData = new Dictionary<string, object>
{
{
"driveRestoreArtifacts@delta" , new List<object>
{
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"restorePoint", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.id", new UntypedString("1b014d8c-71fe-4d00-a01a-31850bc5b32c")
},
})
},
{
"destinationType", new UntypedString("new")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"restorePoint", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.id", new UntypedString("2b014d8c-71fe-4d00-a01a-31850bc5b32")
},
})
},
{
"destinationType", new UntypedString("new")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"restorePoint", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.id", new UntypedString("3b014d8c-71fe-4d00-a01a-31850bc5b32c")
},
})
},
{
"destinationType", new UntypedString("new")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"restorePoint", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.id", new UntypedString("4b014d8c-71fe-4d00-a01a-31850bc5b32c")
},
})
},
{
"destinationType", new UntypedString("new")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@removed", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"reason", new UntypedString("changed")
},
})
},
{
"id", new UntypedString("99954f18-c8ec-4b62-85bf-cdf3b70b140e")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@removed", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"reason", new UntypedString("changed")
},
})
},
{
"id", new UntypedString("4267e382-71a9-4c07-bef7-bda97e09c0d2")
},
}),
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@removed", new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"reason", new UntypedString("changed")
},
})
},
{
"id", new UntypedString("3667e382-71a9-4c07-bef7-bda97e09c0d2")
},
}),
}
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BackupRestore.OneDriveForBusinessRestoreSessions["{oneDriveForBusinessRestoreSession-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OneDriveForBusinessRestoreSession oneDriveForBusinessRestoreSession = new OneDriveForBusinessRestoreSession();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
LinkedList<Object> driveRestoreArtifactsDelta = new LinkedList<Object>();
property = new ();
restorePoint = new ();
restorePoint.setOdataId("1b014d8c-71fe-4d00-a01a-31850bc5b32c");
property.setRestorePoint(restorePoint);
property.setDestinationType("new");
driveRestoreArtifactsDelta.add(property);
property1 = new ();
restorePoint1 = new ();
restorePoint1.setOdataId("2b014d8c-71fe-4d00-a01a-31850bc5b32");
property1.setRestorePoint(restorePoint1);
property1.setDestinationType("new");
driveRestoreArtifactsDelta.add(property1);
property2 = new ();
restorePoint2 = new ();
restorePoint2.setOdataId("3b014d8c-71fe-4d00-a01a-31850bc5b32c");
property2.setRestorePoint(restorePoint2);
property2.setDestinationType("new");
driveRestoreArtifactsDelta.add(property2);
property3 = new ();
restorePoint3 = new ();
restorePoint3.setOdataId("4b014d8c-71fe-4d00-a01a-31850bc5b32c");
property3.setRestorePoint(restorePoint3);
property3.setDestinationType("new");
driveRestoreArtifactsDelta.add(property3);
property4 = new ();
removed = new ();
removed.setReason("changed");
property4.setRemoved(removed);
property4.setId("99954f18-c8ec-4b62-85bf-cdf3b70b140e");
driveRestoreArtifactsDelta.add(property4);
property5 = new ();
removed1 = new ();
removed1.setReason("changed");
property5.setRemoved(removed1);
property5.setId("4267e382-71a9-4c07-bef7-bda97e09c0d2");
driveRestoreArtifactsDelta.add(property5);
property6 = new ();
removed2 = new ();
removed2.setReason("changed");
property6.setRemoved(removed2);
property6.setId("3667e382-71a9-4c07-bef7-bda97e09c0d2");
driveRestoreArtifactsDelta.add(property6);
additionalData.put("driveRestoreArtifacts@delta", driveRestoreArtifactsDelta);
oneDriveForBusinessRestoreSession.setAdditionalData(additionalData);
OneDriveForBusinessRestoreSession result = graphClient.solutions().backupRestore().oneDriveForBusinessRestoreSessions().byOneDriveForBusinessRestoreSessionId("{oneDriveForBusinessRestoreSession-id}").patch(oneDriveForBusinessRestoreSession);