Skip to content

Commit

Permalink
Override Id property in EventSource classes (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Willer authored Feb 20, 2019
1 parent 30ec631 commit 19372ab
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 16 deletions.
7 changes: 5 additions & 2 deletions Box.V2/Models/BoxGroupEventSource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Box.V2.Models
{
Expand All @@ -14,8 +14,11 @@ public class BoxGroupEventSource : BoxEntity
/// The unique id of the group resource.
/// </summary>
[JsonProperty(PropertyName = FieldGroupId)]
public string Id { get; private set; }
public override string Id { get; protected set; }

/// <summary>
/// The type of the object.
/// </summary>
public override string Type { get { return "group"; } protected set { return; } }

/// <summary>
Expand Down
22 changes: 20 additions & 2 deletions Box.V2/Models/BoxGroupFileCollaborationEventSource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Box.V2.Models
{
Expand All @@ -10,20 +10,38 @@ public class BoxGroupFileCollaborationEventSource : BoxEntity
public const string FieldGroupName = "group_name";
public const string FieldParent = "parent";

/// <summary>
/// The unique ID of the file being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFileId)]
public string Id { get; private set; }
public override string Id { get; protected set; }

/// <summary>
/// The type of the object.
/// </summary>
public override string Type { get { return "file"; } protected set { return; } }

/// <summary>
/// The name of the file being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFileName)]
public string Name { get; private set; }

/// <summary>
/// The unique ID of the group collaborating on the file.
/// </summary>
[JsonProperty(PropertyName = FieldGroupId)]
public string GroupId { get; private set; }

/// <summary>
/// The name of the group collaborating on the file.
/// </summary>
[JsonProperty(PropertyName = FieldGroupName)]
public string GroupName { get; private set; }

/// <summary>
/// The parent folder of the file being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldParent)]
public BoxFolder Parent { get; private set; }
}
Expand Down
22 changes: 20 additions & 2 deletions Box.V2/Models/BoxGroupFolderCollaborationEventSource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Box.V2.Models
{
Expand All @@ -10,20 +10,38 @@ public class BoxGroupFolderCollaborationEventSource : BoxEntity
public const string FieldGroupName = "group_name";
public const string FieldParent = "parent";

/// <summary>
/// The unique ID of the folder being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFolderId)]
public string Id { get; private set; }
public override string Id { get; protected set; }

/// <summary>
/// The type of the object.
/// </summary>
public override string Type { get { return "folder"; } protected set { return; } }

/// <summary>
/// The name of the folder being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFolderName)]
public string Name { get; private set; }

/// <summary>
/// The unique ID of the group collaborating on the folder.
/// </summary>
[JsonProperty(PropertyName = FieldGroupId)]
public string GroupId { get; private set; }

/// <summary>
/// The name of the group collaborating on the folder.
/// </summary>
[JsonProperty(PropertyName = FieldGroupName)]
public string GroupName { get; private set; }

/// <summary>
/// The parent folder of the folder being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldParent)]
public BoxFolder Parent { get; private set; }
}
Expand Down
24 changes: 21 additions & 3 deletions Box.V2/Models/BoxUserFileCollaborationEventSource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Box.V2.Models
{
Expand All @@ -10,21 +10,39 @@ public class BoxUserFileCollaborationEventSource : BoxEntity
public const string FieldUserName = "user_name";
public const string FieldParent = "parent";

/// <summary>
/// The unique ID of the file being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFileId)]
public string Id { get; private set; }
public override string Id { get; protected set; }

/// <summary>
/// The type of the object.
/// </summary>
public override string Type { get { return "file"; } protected set { return; } }

/// <summary>
/// The name of the file being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFileName)]
public string Name { get; private set; }

/// <summary>
/// The unique ID of the user collaborating on the file.
/// </summary>
[JsonProperty(PropertyName = FieldUserId)]
public string UserId { get; private set; }

/// <summary>
/// The name of the user collaborating on the file.
/// </summary>
[JsonProperty(PropertyName = FieldUserName)]
public string UserName { get; private set; }

/// <summary>
/// The parent folder of the file being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldParent)]
public BoxFolder Parent { get; private set; }
}
}
}
17 changes: 10 additions & 7 deletions Box.V2/Models/BoxUserFolderCollaborationEventSource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace Box.V2.Models
{
Expand All @@ -14,35 +14,38 @@ public class BoxUserFolderCollaborationEventSource : BoxEntity
public const string FieldParent = "parent";

/// <summary>
/// The Id of the folder.
/// The unique ID of the folder being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFolderId)]
public override string Id { get; protected set; }

/// <summary>
/// The type of the object.
/// </summary>
public override string Type { get { return "folder"; } protected set { return; }}

/// <summary>
/// The name of the folder.
/// The name of the folder being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldFolderName)]
public string Name { get; private set; }

/// <summary>
/// The Id of the user.
/// The Id of the user collaborating on the folder.
/// </summary>
[JsonProperty(PropertyName = FieldUserId)]
public string UserId { get; private set; }

/// <summary>
/// The name of the folder.
/// The name of the user collaborating on the folder.
/// </summary>
[JsonProperty(PropertyName = FieldUserName)]
public string UserName { get; private set; }

/// <summary>
/// The parent folder.
/// The parent folder of the folder being collaborated on.
/// </summary>
[JsonProperty(PropertyName = FieldParent)]
public BoxFolder Parent { get; private set; }
}
}
}

0 comments on commit 19372ab

Please sign in to comment.