Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Representa la carga de trabajo (SharePoint Online, OneDrive para la Empresa, Exchange Online) y la información de identificación asociada a un evento de retención.
eventTriggerDateTime
DateTimeOffset
Hora opcional en la que se debe desencadenar el evento.
retentionEventType
Cadena
Nombre del tipo de evento asociado al evento.
Respuesta
Si se ejecuta correctamente, este método devuelve un 201 Created código de respuesta y un objeto microsoft.graph.security.retentionEvent en el cuerpo de la respuesta.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.Security;
using Microsoft.Kiota.Abstractions.Serialization;
var requestBody = new RetentionEvent
{
OdataType = "#microsoft.graph.security.retentionEvent",
DisplayName = "String",
Description = "String",
EventTriggerDateTime = DateTimeOffset.Parse("String (timestamp)"),
AdditionalData = new Dictionary<string, object>
{
{
"eventQuery" , new List<object>
{
new UntypedObject(new Dictionary<string, UntypedNode>
{
{
"@odata.type", new UntypedString("microsoft.graph.security.eventQuery")
},
}),
}
},
{
"retentionEventType@odata.bind" , "https://graph.microsoft.com/v1.0/security/triggerTypes/retentionEventType/9eecef97-fb3c-4c68-825b-4dd74530863a"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Triggers.RetentionEvents.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.security.RetentionEvent retentionEvent = new com.microsoft.graph.models.security.RetentionEvent();
retentionEvent.setOdataType("#microsoft.graph.security.retentionEvent");
retentionEvent.setDisplayName("String");
retentionEvent.setDescription("String");
OffsetDateTime eventTriggerDateTime = OffsetDateTime.parse("String (timestamp)");
retentionEvent.setEventTriggerDateTime(eventTriggerDateTime);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
LinkedList<Object> eventQuery = new LinkedList<Object>();
property = new ();
property.setOdataType("microsoft.graph.security.eventQuery");
eventQuery.add(property);
additionalData.put("eventQuery", eventQuery);
additionalData.put("retentionEventType@odata.bind", "https://graph.microsoft.com/v1.0/security/triggerTypes/retentionEventType/9eecef97-fb3c-4c68-825b-4dd74530863a");
retentionEvent.setAdditionalData(additionalData);
com.microsoft.graph.models.security.RetentionEvent result = graphClient.security().triggers().retentionEvents().post(retentionEvent);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.security.retention_event import RetentionEvent
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RetentionEvent(
odata_type = "#microsoft.graph.security.retentionEvent",
display_name = "String",
description = "String",
event_trigger_date_time = "String (timestamp)",
additional_data = {
"event_query" : [
{
"@odata_type" : "microsoft.graph.security.eventQuery",
},
],
"retention_event_type@odata_bind" : "https://graph.microsoft.com/v1.0/security/triggerTypes/retentionEventType/9eecef97-fb3c-4c68-825b-4dd74530863a",
}
)
result = await graph_client.security.triggers.retention_events.post(request_body)