Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
No corpo do pedido, forneça apenas os valores das propriedades a atualizar. As propriedades existentes que não estão incluídas no corpo do pedido mantêm os valores anteriores ou são recalculadas com base em alterações a outros valores de propriedade.
A tabela a seguir especifica as propriedades que podem ser atualizadas.
Para remover um artefacto de restauro de unidade, especifique a @removed anotação no corpo do pedido juntamente com o ID do objeto driveRestoreArtifact .
Resposta
Se for bem-sucedido, este método devolve um 200 OK código de resposta e um objeto oneDriveForBusinessRestoreSession atualizado no corpo da resposta.
// 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);