-
Notifications
You must be signed in to change notification settings - Fork 12
/
OneDriveNotification.cs
49 lines (39 loc) · 1.77 KB
/
OneDriveNotification.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
* See LICENSE in the source repository root for complete license information.
*/
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace OneDriveWebhookTranslator.Models
{
public class OneDriveWebhookNotification
{
// The client state used to verify that the notification is from Microsoft Graph. Compare the value received with the notification to the value you sent with the subscription request.
[JsonProperty("clientState")]
public string ClientState { get; set; }
// The endpoint of the resource that changed. For example, a message uses the format ../Users/{user-id}/Messages/{message-id}
[JsonProperty("resource")]
public string Resource { get; set; }
// The date and time when the webhooks subscription expires.
// The time is in UTC, and can be up to three days from the time of subscription creation.
[JsonProperty("subscriptionExpirationDateTime")]
public string SubscriptionExpirationDateTime { get; set; }
// The unique identifier for the webhooks subscription.
[JsonProperty("subscriptionId")]
public string SubscriptionId { get; set; }
[JsonProperty("receivedDateTime", DefaultValueHandling = DefaultValueHandling.Ignore)]
public DateTime ReceivedDateTime { get; set; }
public OneDriveWebhookNotification()
{
this.ReceivedDateTime = DateTime.UtcNow;
}
}
public class OneDriveNotificationCollection
{
[JsonProperty("value")]
public OneDriveWebhookNotification[] Notifications { get; set; }
}
}