diff --git a/Box.V2.Test/BoxEventsManagerTest.cs b/Box.V2.Test/BoxEventsManagerTest.cs index a74b6e1e4..5e86542e1 100644 --- a/Box.V2.Test/BoxEventsManagerTest.cs +++ b/Box.V2.Test/BoxEventsManagerTest.cs @@ -70,7 +70,7 @@ public async Task GetGroupEvents_ValidResponse() [TestMethod] public async Task GetUserEventsFile_ValidResponse() { - var responseString = "{\"chunk_size\": 1, \"next_stream_position\": 123, \"entries\": [{\"source\":{\"file_id\":\"283257336425\",\"file_name\":\"ScreenShot2018-03-12at5.44.00PM.png\",\"user_id\":\"285663442\",\"user_name\":\"foo\",\"parent\":{\"type\":\"folder\",\"name\":\"AllFiles\",\"id\":\"0\"}},\"created_by\":{\"type\":\"user\",\"id\":\"11111\",\"name\":\"Test User\",\"login\":\"test@user.com\"},\"created_at\":\"2018-03-16T15:12:52-07:00\",\"event_id\":\"85c57bf3-bc15-4d24-93bc-955c796217c8\",\"event_type\":\"COLLABORATION_INVITE\",\"ip_address\":\"UnknownIP\",\"type\":\"event\",\"session_id\":null,\"additional_details\":null}]}"; + var responseString = "{\"chunk_size\": 1, \"next_stream_position\": 123, \"entries\": [{\"source\":{\"file_id\":\"283257336425\",\"file_name\":\"ScreenShot2018-03-12at5.44.00PM.png\",\"user_id\":\"285663442\",\"user_name\":\"foo\",\"user_email\": \"testuser@example.com\",\"parent\":{\"type\":\"folder\",\"name\":\"AllFiles\",\"id\":\"0\"},\"owned_by\":{\"type\": \"user\",\"id\":\"33333\",\"name\": \"Test User\",\"login\":\"testuser@example.com\"}},\"created_by\":{\"type\":\"user\",\"id\":\"11111\",\"name\":\"Test User\",\"login\":\"test@user.com\"},\"created_at\":\"2018-03-16T15:12:52-07:00\",\"event_id\":\"85c57bf3-bc15-4d24-93bc-955c796217c8\",\"event_type\":\"COLLABORATION_INVITE\",\"ip_address\":\"UnknownIP\",\"type\":\"event\",\"session_id\":null,\"additional_details\":null}]}"; IBoxRequest boxRequest = null; Handler.Setup(h => h.ExecuteAsync>(It.IsAny())) .Returns(Task.FromResult>>(new BoxResponse>() @@ -88,6 +88,9 @@ public async Task GetUserEventsFile_ValidResponse() Assert.AreEqual(userFileEvents.Entries[0].Source.GetType(), typeof(BoxUserFileCollaborationEventSource)); Assert.AreEqual(userFileEventSource.Id, "283257336425"); Assert.AreEqual(userFileEventSource.Name, "ScreenShot2018-03-12at5.44.00PM.png"); + Assert.AreEqual(userFileEventSource.UserEmail, "testuser@example.com"); + Assert.AreEqual(userFileEventSource.OwnedBy.Id, "33333"); + Assert.AreEqual(userFileEventSource.OwnedBy.Name, "Test User"); } [TestMethod] diff --git a/Box.V2/Models/BoxFileEventSource.cs b/Box.V2/Models/BoxFileEventSource.cs index 7e847dda7..304143e9b 100644 --- a/Box.V2/Models/BoxFileEventSource.cs +++ b/Box.V2/Models/BoxFileEventSource.cs @@ -11,6 +11,7 @@ public class BoxFileEventSource : BoxEntity public const string FieldItemId = "item_id"; public const string FieldItemName = "item_name"; public const string FieldItemParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The type of the event source @@ -35,5 +36,11 @@ public class BoxFileEventSource : BoxEntity /// [JsonProperty(PropertyName = FieldItemParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } } diff --git a/Box.V2/Models/BoxFolderEventSource.cs b/Box.V2/Models/BoxFolderEventSource.cs index a8b69ac47..35c5fc739 100644 --- a/Box.V2/Models/BoxFolderEventSource.cs +++ b/Box.V2/Models/BoxFolderEventSource.cs @@ -11,6 +11,7 @@ public class BoxFolderEventSource : BoxEntity public const string FieldItemId = "item_id"; public const string FieldItemName = "item_name"; public const string FieldItemParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The type of the event source @@ -35,5 +36,11 @@ public class BoxFolderEventSource : BoxEntity /// [JsonProperty(PropertyName = FieldItemParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } } diff --git a/Box.V2/Models/BoxGroupFileCollaborationEventSource.cs b/Box.V2/Models/BoxGroupFileCollaborationEventSource.cs index 485066090..ffc18e445 100644 --- a/Box.V2/Models/BoxGroupFileCollaborationEventSource.cs +++ b/Box.V2/Models/BoxGroupFileCollaborationEventSource.cs @@ -9,6 +9,7 @@ public class BoxGroupFileCollaborationEventSource : BoxEntity public const string FieldGroupId = "group_id"; public const string FieldGroupName = "group_name"; public const string FieldParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The unique ID of the file being collaborated on. @@ -44,5 +45,11 @@ public class BoxGroupFileCollaborationEventSource : BoxEntity /// [JsonProperty(PropertyName = FieldParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } } diff --git a/Box.V2/Models/BoxGroupFolderCollaborationEventSource.cs b/Box.V2/Models/BoxGroupFolderCollaborationEventSource.cs index ce1e1da62..2897211f9 100644 --- a/Box.V2/Models/BoxGroupFolderCollaborationEventSource.cs +++ b/Box.V2/Models/BoxGroupFolderCollaborationEventSource.cs @@ -9,6 +9,7 @@ public class BoxGroupFolderCollaborationEventSource : BoxEntity public const string FieldGroupId = "group_id"; public const string FieldGroupName = "group_name"; public const string FieldParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The unique ID of the folder being collaborated on. @@ -44,5 +45,11 @@ public class BoxGroupFolderCollaborationEventSource : BoxEntity /// [JsonProperty(PropertyName = FieldParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } } diff --git a/Box.V2/Models/BoxUserFileCollaborationEventSource.cs b/Box.V2/Models/BoxUserFileCollaborationEventSource.cs index b3a961df1..eaa03e9fa 100644 --- a/Box.V2/Models/BoxUserFileCollaborationEventSource.cs +++ b/Box.V2/Models/BoxUserFileCollaborationEventSource.cs @@ -8,7 +8,9 @@ public class BoxUserFileCollaborationEventSource : BoxEntity public const string FieldFileName = "file_name"; public const string FieldUserId = "user_id"; public const string FieldUserName = "user_name"; + public const string FieldUserEmail = "user_email"; public const string FieldParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The unique ID of the file being collaborated on. @@ -39,10 +41,22 @@ public class BoxUserFileCollaborationEventSource : BoxEntity [JsonProperty(PropertyName = FieldUserName)] public string UserName { get; private set; } + /// + /// The email of the user collaborating on the file. + /// + [JsonProperty(PropertyName = FieldUserEmail)] + public string UserEmail { get; private set; } + /// /// The parent folder of the file being collaborated on. /// [JsonProperty(PropertyName = FieldParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } } diff --git a/Box.V2/Models/BoxUserFolderCollaborationEventSource.cs b/Box.V2/Models/BoxUserFolderCollaborationEventSource.cs index 668285d62..f50a09e4c 100644 --- a/Box.V2/Models/BoxUserFolderCollaborationEventSource.cs +++ b/Box.V2/Models/BoxUserFolderCollaborationEventSource.cs @@ -11,7 +11,9 @@ public class BoxUserFolderCollaborationEventSource : BoxEntity public const string FieldFolderName = "folder_name"; public const string FieldUserId = "user_id"; public const string FieldUserName = "user_name"; + public const string FieldUserEmail = "user_email"; public const string FieldParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The unique ID of the folder being collaborated on. @@ -42,10 +44,22 @@ public class BoxUserFolderCollaborationEventSource : BoxEntity [JsonProperty(PropertyName = FieldUserName)] public string UserName { get; private set; } + /// + /// The email of the user collaborating on the folder. + /// + [JsonProperty(PropertyName = FieldUserEmail)] + public string UserEmail { get; private set; } + /// /// The parent folder of the folder being collaborated on. /// [JsonProperty(PropertyName = FieldParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } } diff --git a/Box.V2/Models/BoxWebLinkEventSource.cs b/Box.V2/Models/BoxWebLinkEventSource.cs index 0a3f27621..9a7198586 100644 --- a/Box.V2/Models/BoxWebLinkEventSource.cs +++ b/Box.V2/Models/BoxWebLinkEventSource.cs @@ -11,6 +11,7 @@ public class BoxWebLinkEventSource : BoxEntity public const string FieldItemId = "item_id"; public const string FieldItemName = "item_name"; public const string FieldItemParent = "parent"; + public const string FieldOwnedBy = "owned_by"; /// /// The type of the event source @@ -35,5 +36,11 @@ public class BoxWebLinkEventSource : BoxEntity /// [JsonProperty(PropertyName = FieldItemParent)] public BoxFolder Parent { get; private set; } + + /// + /// The user who owns this item + /// + [JsonProperty(PropertyName = FieldOwnedBy)] + public BoxUser OwnedBy { get; private set; } } }