-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathWebhooksNotificationdto.cs
68 lines (56 loc) · 1.79 KB
/
WebhooksNotificationdto.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
////*********************************************************
// <copyright company="Intuit">
// Author:Nimisha
//
////*********************************************************
using DevDefined.OAuth.Consumer;
using DevDefined.OAuth.Framework;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using Newtonsoft.Json;
namespace Webhooks.Models.DTO
{
//Model for mapping Webhooks response to diff classes for deserialization
public class WebhooksNotificationdto
{
public string ConnectionString
{
get { return ConfigurationManager.ConnectionStrings["DBContext"].ToString(); }
}
public class Entities
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("operation")]
public string Operation { get; set; }
[JsonProperty("lastUpdated")]
public string LastUpdated { get; set; } //validate type
}
public class DataChangeEvents
{
[JsonProperty("entities")]
public List<Entities> Entities { get; set; }
}
public class EventNotifications
{
[JsonProperty("realmId")]
public string RealmId { get; set; }
[JsonProperty("dataChangeEvent")]
public DataChangeEvents DataEvents { get; set; }
}
public class WebhooksData
{
[JsonProperty("eventNotifications")]
public List<EventNotifications> EventNotifications { get; set; }
}
}
}