From 298ecec83256ad3b47c86d8763a56dd802e6752f Mon Sep 17 00:00:00 2001 From: Adam Yeager Date: Sun, 30 Aug 2015 20:58:54 -0400 Subject: [PATCH] Updated the PushResponseFilter with an email property and updated the GetPushes method to work with the additional property. Signed-off-by: Adam Yeager --- PushbulletSharp.Tests/PushTests.cs | 18 ++++++++++++++++++ PushbulletSharp/Filters/PushResponseFilter.cs | 8 ++++++++ PushbulletSharp/Properties/AssemblyInfo.cs | 4 ++-- PushbulletSharp/PushbulletClient.cs | 6 ++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/PushbulletSharp.Tests/PushTests.cs b/PushbulletSharp.Tests/PushTests.cs index c63ca07..c2044bd 100644 --- a/PushbulletSharp.Tests/PushTests.cs +++ b/PushbulletSharp.Tests/PushTests.cs @@ -326,5 +326,23 @@ public void GetPushesAllWithCursor() Assert.Fail(ex.Message); } } + + [TestMethod] + public void GatAllPushesByEmail() + { + try + { + var filter = new PushResponseFilter() + { + Email = "john.smith@aninternetwebsite.com" + }; + + var results = Client.GetPushes(filter); + } + catch (Exception ex) + { + Assert.Fail(ex.Message); + } + } } } \ No newline at end of file diff --git a/PushbulletSharp/Filters/PushResponseFilter.cs b/PushbulletSharp/Filters/PushResponseFilter.cs index ba27c01..07fe9f3 100644 --- a/PushbulletSharp/Filters/PushResponseFilter.cs +++ b/PushbulletSharp/Filters/PushResponseFilter.cs @@ -52,5 +52,13 @@ public PushResponseFilter(string cursor) /// The cursor. /// public string Cursor { get; set; } + + /// + /// Gets or sets the email. + /// + /// + /// The email. + /// + public string Email { get; set; } } } \ No newline at end of file diff --git a/PushbulletSharp/Properties/AssemblyInfo.cs b/PushbulletSharp/Properties/AssemblyInfo.cs index 2e0b90d..75ac960 100644 --- a/PushbulletSharp/Properties/AssemblyInfo.cs +++ b/PushbulletSharp/Properties/AssemblyInfo.cs @@ -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")] diff --git a/PushbulletSharp/PushbulletClient.cs b/PushbulletSharp/PushbulletClient.cs index 9d27195..a0d6c13 100644 --- a/PushbulletSharp/PushbulletClient.cs +++ b/PushbulletSharp/PushbulletClient.cs @@ -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));