-
Notifications
You must be signed in to change notification settings - Fork 12
/
OneDriveSubscription.cs
49 lines (40 loc) · 2.17 KB
/
OneDriveSubscription.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 System;
using Newtonsoft.Json;
namespace OneDriveWebhookTranslator.Models
{
public class OneDriveSubscription
{
// The string that MS Graph should send with each notification. Maximum length is 255 characters.
// To verify that the notification is from MS Graph, compare the value received with the notification to the value you sent with the subscription request.
[JsonProperty("clientState", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string ClientState { get; set; }
// The URL of the endpoint that receives the subscription response and notifications. Requires https.
[JsonProperty("notificationUrl", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string NotificationUrl { get; set; }
// The resource to monitor for changes.
[JsonProperty("resource", DefaultValueHandling = DefaultValueHandling.Ignore)]
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("expirationDateTime", DefaultValueHandling = DefaultValueHandling.Ignore)]
public DateTimeOffset SubscriptionExpirationDateTime { get; set; }
// The unique identifier for the webhooks subscription.
[JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string SubscriptionId { get; set; }
// OneDrive Personal requires scenarios to be passed currently. This requirement will be removed in the future
[JsonProperty("scenarios", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string[] Scenarios { get; set; }
public OneDriveSubscription()
{
this.Scenarios = new string[] { "Webhook" };
}
}
public class SubscriptionViewModel
{
public OneDriveSubscription Subscription { get; set; }
}
}