From 840d14d185a47042c7ca75cd792ac6eb265b4924 Mon Sep 17 00:00:00 2001 From: vmalinovskiy Date: Wed, 6 Mar 2019 14:06:47 +0200 Subject: [PATCH 1/2] vmalinovskiy - added date interval filtering parameters to broadcasts lookup --- CallfireApiClient.nuspec | 208 +++++++++--------- Changelog.txt | 3 + .../Api/Campaigns/CallBroadcastsApiTest.cs | 14 +- .../Model/Request/FindBroadcastsRequest.cs | 10 +- .../Properties/AssemblyInfo.cs | 2 +- 5 files changed, 131 insertions(+), 106 deletions(-) diff --git a/CallfireApiClient.nuspec b/CallfireApiClient.nuspec index 98ca196..2474b1f 100644 --- a/CallfireApiClient.nuspec +++ b/CallfireApiClient.nuspec @@ -1,7 +1,7 @@ CallfireApiClient - 1.1.27 + 1.1.28 CallFire API v2 client Vladimir Mikhailov @@ -13,107 +13,111 @@ https://www.callfire.com/favicon.ico false C# client library for integration with Callfire REST API v2 services - Callfire API client Changelog -============================= -Version 1.1.27 - Feb 28 2019 - - fixed isssue with Broadcast Status enum - -Version 1.1.26 - Jan 17 2019 - - updated RestSharp version to 106.6 - -Version 1.1.24 - Oct 17 2018 - - removed potential security vulnerability connected with DotNetZip library - -Version 1.1.23 - Sept 26 2018 - - added findMedia API operation to sdk - -Version 1.1.22 - Sept 04 2018 - - updated version of RestSharp client to 106.3.0 - - downgraded version of .NET framework to 4.6 - -Version 1.1.21 - August 10 2018 - - added StrongNamer library to sign unsigned assembly in a nuget package - -Version 1.1.20 - August 1 2018 - - updated .NET framework target version to latest for support TLS 1.2 by default - -Version 1.1.19 - Jun 13 2017 -- added fromNumber to Recipient object for sending calls/texts -- added strictValidation flag for adding contacts to broadcast -- added useCustomFields to createContactList/addContactListContacts apis -- added media array parameter for TextRecipient -- added a way to upload files from byte array for media and campaign sounds api - -Version 1.1.18 - May 29 2017 -- upgraded dependencies - -Version 1.1.17 - May 4 2017 -- removed subscriptions api (not supported from v2 api client) -- fixed findWebhooks api to use enums instead strings -- trivial tests fixes - -Version 1.1.16 - Mar 28 2017 -- fixed DayOfWeek enum for scheduler - -Version 1.1.15 - Jan 27 2017 -- added dnc apis - -Version 1.1.14 - Jan 17 2017 -- added possibility to use client without config file - -Version 1.1.13 - Dec 30 2016 -- minor fixes for get contacts history api - -Version 1.1.12 - Dec 28 2016 -- updated CallRecord dto to include originateTime, answerTime, duration, callerName and switchId fields -- updated Webhook dto to include singleUse parameter -- minor extension of requests objects for upload and find sounds api, get contacts history api and find tollfree numbers api -- temporary turning dnc api off due to full remake of callfire dnc apis - -Version 1.1.11 - Nov 18 2016 -- added deleteCampaignSound api -- added getCreditsHistory api -- remove dnc lists api (not supported anymore) - -Version 1.1.10 - Oct 26 2016 -- added more parameters to call tracking config in Number Lease config object - -Version 1.1.9 - Jul 11 2016 -- added loading labels parameter in Number Lease objects - -Version 1.1.8 - May 27 2016 -- defaultLiveMessage, defaultMachineMessage, defaultLiveMessageSoundId, defaultMachineMessageSoundId, defaultVoice params added to send calls api -- added batch id filter parameter for get broadcast calls/texts -- added fields filter parameter for add sound via call, returns CampaignSound object -- added fields filter parameter for add sound via text-to-speech, returns CampaignSound object -- defaultMessage parameter added to send texts function -- added findWebhookResource and findWebhookResources methods to use new webhooks apis -- resumeNextDay parameter added to CallBroadcast object -- transferMessage, transferMessageSoundId, transferDigit, transferNumber params added to CallRecipient object for sending calls and texts -- added questionResponses parameter to CallRecord object -- added duplicate parameter to CampaignSound object -- get call recordings api functions implemented in CallsApi - -Version 1.1.7 - Apr 18 2016 -- migration to 4.5 net framework -- migration to gradle - -Version 1.1.6 - Mar 25 2016 -- added mono debug files generation on Windows platform -- removed get/update batch api calls from TextBroadcastsApi - -Version 1.1.5 - Mar 14 2016 -- added debug support for Mono platform -- fixed issue with uploading mp3 media - -Version 1.1.4 - Mar 4 2016 -- added proxy with basic authorization support, see out docs how to configure it. - -Version 1.1.3 - Feb 16 2016 -- added nuget symbolsource package to debug source code. - -Version 1.1.2 - Jan 27 2016 -- added find by batchId parameter to FindCalls & FindTexts requests. + + Callfire API client Changelog + ============================= + Version 1.1.28 - March 06 2019 + - added date interval filtering parameters to broadcasts lookup + + Version 1.1.27 - Feb 28 2019 + - fixed isssue with Broadcast Status enum + + Version 1.1.26 - Jan 17 2019 + - updated RestSharp version to 106.6 + + Version 1.1.24 - Oct 17 2018 + - removed potential security vulnerability connected with DotNetZip library + + Version 1.1.23 - Sept 26 2018 + - added findMedia API operation to sdk + + Version 1.1.22 - Sept 04 2018 + - updated version of RestSharp client to 106.3.0 + - downgraded version of .NET framework to 4.6 + + Version 1.1.21 - August 10 2018 + - added StrongNamer library to sign unsigned assembly in a nuget package + + Version 1.1.20 - August 1 2018 + - updated .NET framework target version to latest for support TLS 1.2 by default + + Version 1.1.19 - Jun 13 2017 + - added fromNumber to Recipient object for sending calls/texts + - added strictValidation flag for adding contacts to broadcast + - added useCustomFields to createContactList/addContactListContacts apis + - added media array parameter for TextRecipient + - added a way to upload files from byte array for media and campaign sounds api + + Version 1.1.18 - May 29 2017 + - upgraded dependencies + + Version 1.1.17 - May 4 2017 + - removed subscriptions api (not supported from v2 api client) + - fixed findWebhooks api to use enums instead strings + - trivial tests fixes + + Version 1.1.16 - Mar 28 2017 + - fixed DayOfWeek enum for scheduler + + Version 1.1.15 - Jan 27 2017 + - added dnc apis + + Version 1.1.14 - Jan 17 2017 + - added possibility to use client without config file + + Version 1.1.13 - Dec 30 2016 + - minor fixes for get contacts history api + + Version 1.1.12 - Dec 28 2016 + - updated CallRecord dto to include originateTime, answerTime, duration, callerName and switchId fields + - updated Webhook dto to include singleUse parameter + - minor extension of requests objects for upload and find sounds api, get contacts history api and find tollfree numbers api + - temporary turning dnc api off due to full remake of callfire dnc apis + + Version 1.1.11 - Nov 18 2016 + - added deleteCampaignSound api + - added getCreditsHistory api + - remove dnc lists api (not supported anymore) + + Version 1.1.10 - Oct 26 2016 + - added more parameters to call tracking config in Number Lease config object + + Version 1.1.9 - Jul 11 2016 + - added loading labels parameter in Number Lease objects + + Version 1.1.8 - May 27 2016 + - defaultLiveMessage, defaultMachineMessage, defaultLiveMessageSoundId, defaultMachineMessageSoundId, defaultVoice params added to send calls api + - added batch id filter parameter for get broadcast calls/texts + - added fields filter parameter for add sound via call, returns CampaignSound object + - added fields filter parameter for add sound via text-to-speech, returns CampaignSound object + - defaultMessage parameter added to send texts function + - added findWebhookResource and findWebhookResources methods to use new webhooks apis + - resumeNextDay parameter added to CallBroadcast object + - transferMessage, transferMessageSoundId, transferDigit, transferNumber params added to CallRecipient object for sending calls and texts + - added questionResponses parameter to CallRecord object + - added duplicate parameter to CampaignSound object + - get call recordings api functions implemented in CallsApi + + Version 1.1.7 - Apr 18 2016 + - migration to 4.5 net framework + - migration to gradle + + Version 1.1.6 - Mar 25 2016 + - added mono debug files generation on Windows platform + - removed get/update batch api calls from TextBroadcastsApi + + Version 1.1.5 - Mar 14 2016 + - added debug support for Mono platform + - fixed issue with uploading mp3 media + + Version 1.1.4 - Mar 4 2016 + - added proxy with basic authorization support, see out docs how to configure it. + + Version 1.1.3 - Feb 16 2016 + - added nuget symbolsource package to debug source code. + + Version 1.1.2 - Jan 27 2016 + - added find by batchId parameter to FindCalls & FindTexts requests. - fixed NumberApi.findNumbersLocal and NumberApi.findNumbersTollfree methods to accept an updated server responses Version 1.1.1 - Jan 25 2016 diff --git a/Changelog.txt b/Changelog.txt index f0421af..db2579f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,8 @@ Callfire API client Changelog ============================= +Version 1.1.28 - March 06 2019 +- added date interval filtering parameters to broadcasts lookup + Version 1.1.27 - Feb 28 2019 - fixed isssue with Broadcast Status enum diff --git a/src/CallfireApiClient.Tests/Api/Campaigns/CallBroadcastsApiTest.cs b/src/CallfireApiClient.Tests/Api/Campaigns/CallBroadcastsApiTest.cs index b0f1bef..67d9bea 100644 --- a/src/CallfireApiClient.Tests/Api/Campaigns/CallBroadcastsApiTest.cs +++ b/src/CallfireApiClient.Tests/Api/Campaigns/CallBroadcastsApiTest.cs @@ -88,7 +88,10 @@ public void Find() Limit = 5, Name = "name", Label = "label", - Running = true + Running = true, + Scheduled = true, + IntervalBegin = DateTime.UtcNow.AddMonths(-2), + IntervalEnd = DateTime.UtcNow }; var broadcasts = Client.CallBroadcastsApi.Find(request); Assert.That(Serializer.Serialize(broadcasts), Is.EqualTo(expectedJson)); @@ -100,6 +103,15 @@ public void Find() Assert.That(restRequest.Value.Parameters, Has.Some.Matches(p => p.Name.Equals("name") && p.Value.Equals("name"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches(p => p.Name.Equals("label") && p.Value.Equals("label"))); Assert.That(restRequest.Value.Parameters, Has.Some.Matches(p => p.Name.Equals("running") && p.Value.Equals("True"))); + Assert.That(restRequest.Value.Parameters, Has.Some.Matches(p => p.Name.Equals("scheduled") && p.Value.Equals("True"))); + + DateTime intBeg = (DateTime)request.IntervalBegin; + DateTime intEnd = (DateTime)request.IntervalEnd; + long ib = (long)(intBeg.ToUniversalTime() - ClientConstants.EPOCH).TotalMilliseconds; + long ie = (long)(intEnd.ToUniversalTime() - ClientConstants.EPOCH).TotalMilliseconds; + + Assert.That(restRequest.Value.Parameters, Has.Some.Matches(p => p.Name.Equals("intervalBegin") && p.Value.Equals(ib.ToString()))); + Assert.That(restRequest.Value.Parameters, Has.Some.Matches(p => p.Name.Equals("intervalEnd") && p.Value.Equals(ie.ToString()))); } [Test] diff --git a/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs b/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs index 8157b6d..e9e8779 100644 --- a/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs +++ b/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs @@ -11,10 +11,16 @@ public class FindBroadcastsRequest : FindRequest public bool? Running { get; set; } + public bool? Scheduled { get; set; } + + public DateTime? IntervalBegin { get; set; } + + public DateTime? IntervalEnd { get; set; } + public override string ToString() { - return string.Format("[{0} FindBroadcastsRequest: Label={1}, Name={2}, Running={3}]", - base.ToString(), Label, Name, Running); + return string.Format("[{0} FindBroadcastsRequest: Label={1}, Name={2}, Running={3}, Scheduled={4}, intervalBegin={5}, intervalEnd={6}]", + base.ToString(), Label, Name, Running, IntervalBegin, IntervalEnd); } } } diff --git a/src/CallfireApiClient/Properties/AssemblyInfo.cs b/src/CallfireApiClient/Properties/AssemblyInfo.cs index 3c82369..e2c2f53 100644 --- a/src/CallfireApiClient/Properties/AssemblyInfo.cs +++ b/src/CallfireApiClient/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion("1.1.27.*")] +[assembly: AssemblyVersion("1.1.28.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. From fc20cd5e994fd217b3edcaaacb654c812499b0b2 Mon Sep 17 00:00:00 2001 From: vmalinovskiy Date: Wed, 6 Mar 2019 14:11:07 +0200 Subject: [PATCH 2/2] vmalinovskiy - fixed toString for FindBroadcastRequest --- .../Api/Campaigns/Model/Request/FindBroadcastsRequest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs b/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs index e9e8779..2c28efd 100644 --- a/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs +++ b/src/CallfireApiClient/Api/Campaigns/Model/Request/FindBroadcastsRequest.cs @@ -20,7 +20,7 @@ public class FindBroadcastsRequest : FindRequest public override string ToString() { return string.Format("[{0} FindBroadcastsRequest: Label={1}, Name={2}, Running={3}, Scheduled={4}, intervalBegin={5}, intervalEnd={6}]", - base.ToString(), Label, Name, Running, IntervalBegin, IntervalEnd); + base.ToString(), Label, Name, Running, Scheduled, IntervalBegin, IntervalEnd); } } }