Skip to content

Commit

Permalink
Updated the PushResponseFilter with an email property and updated the…
Browse files Browse the repository at this point in the history
… GetPushes method to work with the additional property.

Signed-off-by: Adam Yeager <[email protected]>
  • Loading branch information
adamyeager committed Aug 31, 2015
1 parent 01ff576 commit 298ecec
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
18 changes: 18 additions & 0 deletions PushbulletSharp.Tests/PushTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,23 @@ public void GetPushesAllWithCursor()
Assert.Fail(ex.Message);
}
}

[TestMethod]
public void GatAllPushesByEmail()
{
try
{
var filter = new PushResponseFilter()
{
Email = "[email protected]"
};

var results = Client.GetPushes(filter);
}
catch (Exception ex)
{
Assert.Fail(ex.Message);
}
}
}
}
8 changes: 8 additions & 0 deletions PushbulletSharp/Filters/PushResponseFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,13 @@ public PushResponseFilter(string cursor)
/// The cursor.
/// </value>
public string Cursor { get; set; }

/// <summary>
/// Gets or sets the email.
/// </summary>
/// <value>
/// The email.
/// </value>
public string Email { get; set; }
}
}
4 changes: 2 additions & 2 deletions PushbulletSharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyVersion("2.1.1.0")]
[assembly: AssemblyFileVersion("2.1.1.0")]
6 changes: 6 additions & 0 deletions PushbulletSharp/PushbulletClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@ public PushResponseContainer GetPushes(PushResponseFilter filter)
queryStringList.Add(activeQueryString);
}

if(!string.IsNullOrWhiteSpace(filter.Email))
{
string emailQueryString = string.Format("email={0}", filter.Email);
queryStringList.Add(emailQueryString);
}

if (queryStringList.Count() > 0)
{
queryString = string.Concat("?", string.Join("&", queryStringList));
Expand Down

0 comments on commit 298ecec

Please sign in to comment.