diff --git a/CallfireApiClient.nuspec b/CallfireApiClient.nuspec index f0fe84e..4586ff9 100644 --- a/CallfireApiClient.nuspec +++ b/CallfireApiClient.nuspec @@ -1,7 +1,7 @@ CallfireApiClient - 1.1.17 + 1.1.18 CallFire API v2 client Vladimir Mikhailov @@ -15,6 +15,9 @@ C# client library for integration with Callfire REST API v2 services Callfire API client Changelog ============================= +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 @@ -107,7 +110,6 @@ Version 1.0.0 - Dec 29 2015 - diff --git a/Changelog.txt b/Changelog.txt index 28359df..11ef9c1 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,8 @@ Callfire API client Changelog ============================= +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 diff --git a/build.gradle b/build.gradle index 084935f..40333f6 100644 --- a/build.gradle +++ b/build.gradle @@ -5,12 +5,12 @@ import groovy.xml.XmlUtil import groovy.xml.StreamingMarkupBuilder plugins { - id 'com.ullink.msbuild' version '2.14' - id 'com.ullink.nuget' version '2.12' - id 'com.ullink.nunit' version '1.4' - id 'com.ullink.opencover' version '1.2' - id 'net.researchgate.release' version '2.3.4' - id 'com.github.jlouns.cpe' version '0.4.1' + id 'com.ullink.msbuild' version '2.16' + id 'com.ullink.nuget' version '2.15' + id 'com.ullink.nunit' version '1.10' + id 'com.ullink.opencover' version '1.7' + id 'net.researchgate.release' version '2.6.0' + id 'com.github.jlouns.cpe' version '0.5.0' id "co.riiid.gradle" version "0.4.2" } @@ -50,41 +50,43 @@ nunit { } nunit.dependsOn msbuild -task updateNuspecFile << { - def specFile = file('CallfireApiClient.nuspec') - def spec = new XmlSlurper().parse(specFile) - - project.version = patchVersion(spec.metadata.version.text) - spec.metadata.version = project.version - spec.metadata.releaseNotes = file('Changelog.txt').text - // cleanup previous lib/ and src/ files since they depend on build configuration - spec.files.file.findAll { it.@target == 'lib' || it.@target == 'src' }.each { it.replaceNode {} } - - def isWindowsOs = Os.isFamily(Os.FAMILY_WINDOWS) - def monoInstallation = "$System.env.MONO_HOME" - def pdbToMdbConverter - if (isWindowsOs) { - if (monoInstallation != 'null') { - pdbToMdbConverter = "$System.env.MONO_HOME" + "\\bin\\pdb2mdb.bat" - exec { commandLine = [pdbToMdbConverter, "$assemblyBinDebugDir/${archivesBaseName}.dll"] } - } - } +task updateNuspecFile { + doLast { + def specFile = file('CallfireApiClient.nuspec') + def spec = new XmlSlurper().parse(specFile) - spec.files.appendNode { - file(src: "src/**/*.cs", target: 'src') {} - file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll", target: 'lib') {} - file(src: "$assemblyBinReleaseDir/${archivesBaseName}.dll.config", target: 'lib') {} - file(src: "$assemblyBinReleaseDir/${archivesBaseName}.xml", target: 'lib') {} + project.version = patchVersion(spec.metadata.version.text) + spec.metadata.version = project.version + spec.metadata.releaseNotes = file('Changelog.txt').text + // cleanup previous lib/ and src/ files since they depend on build configuration + spec.files.file.findAll { it.@target == 'lib' || it.@target == 'src' }.each { it.replaceNode {} } + + def isWindowsOs = Os.isFamily(Os.FAMILY_WINDOWS) + def monoInstallation = "$System.env.MONO_HOME" + def pdbToMdbConverter if (isWindowsOs) { - file(src: "$assemblyBinDebugDir/${archivesBaseName}.pdb", target: 'lib') {} + if (monoInstallation != 'null') { + pdbToMdbConverter = "$System.env.MONO_HOME" + "\\bin\\pdb2mdb.bat" + exec { commandLine = [pdbToMdbConverter, "$assemblyBinDebugDir/${archivesBaseName}.dll"] } + } + } + + spec.files.appendNode { + file(src: "src/**/*.cs", target: 'src') {} + file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll", target: 'lib') {} + file(src: "$assemblyBinReleaseDir/${archivesBaseName}.dll.config", target: 'lib') {} + file(src: "$assemblyBinReleaseDir/${archivesBaseName}.xml", target: 'lib') {} + if (isWindowsOs) { + file(src: "$assemblyBinDebugDir/${archivesBaseName}.pdb", target: 'lib') {} + } + file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll.mdb", target: 'lib') {} } - file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll.mdb", target: 'lib') {} + + def fw = new FileWriter('CallfireApiClient.nuspec') + XmlUtil.serialize(spec, fw) + // have to close manually because on windows file remains locked + fw.close() } - - def fw = new FileWriter('CallfireApiClient.nuspec') - XmlUtil.serialize(spec, fw) - // have to close manually because on windows file remains locked - fw.close() } updateNuspecFile.dependsOn msbuildDebug @@ -122,34 +124,36 @@ nugetPack { } nugetPack.dependsOn zipBinaries -task prepareTestData () << { - def inFile = file('src/CallfireApiClient.IntegrationTests/App.config') - def xml = new XmlSlurper().parse(inFile) - - def apiLogin - def apiPassword - - try { - apiLogin = "${testApiUsername}" - apiPassword = "${testApiPassword}" - println([ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ]) - } catch(Exception ex) { - println("Api Username and/or Password are empty, you can't run integrationTests task, set them with -PtestApiUsername/-PtestApiPassword options") - apiLogin = "login" - apiPassword = "password" - } - - if (apiLogin != 'null' && apiPassword != 'null') { - xml.appSettings.add.findAll { it.@key == 'testLogin' || it.@key == 'testPassword' }.each { it.replaceNode {} } - xml.appSettings.appendNode { - add(key: "testLogin", value: apiLogin) {} - add(key: "testPassword", value: apiPassword) {} +task prepareTestData { + doLast { + def inFile = file('src/CallfireApiClient.IntegrationTests/App.config') + def xml = new XmlSlurper().parse(inFile) + + def apiLogin + def apiPassword + + try { + apiLogin = "${testApiUsername}" + apiPassword = "${testApiPassword}" + println([ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ]) + } catch(Exception ex) { + println("Api Username and/or Password are empty, you can't run integrationTests task, set them with -PtestApiUsername/-PtestApiPassword options") + apiLogin = "login" + apiPassword = "password" + } + + if (apiLogin != 'null' && apiPassword != 'null') { + xml.appSettings.add.findAll { it.@key == 'testLogin' || it.@key == 'testPassword' }.each { it.replaceNode {} } + xml.appSettings.appendNode { + add(key: "testLogin", value: apiLogin) {} + add(key: "testPassword", value: apiPassword) {} + } } + def fw = new FileWriter('src/CallfireApiClient.IntegrationTests/App.config') + XmlUtil.serialize(xml, fw) + // have to close manually because on windows file remains locked + fw.close() } - def fw = new FileWriter('src/CallfireApiClient.IntegrationTests/App.config') - XmlUtil.serialize(xml, fw) - // have to close manually because on windows file remains locked - fw.close() } task msbuildForIntegrationTests (type: com.ullink.Msbuild) { @@ -164,29 +168,33 @@ task integrationTests (type: com.ullink.gradle.nunit.NUnit) { } integrationTests.dependsOn msbuildForIntegrationTests -task prepareReleaseData () << { - try { - println("${gitHubOwner}") - println("${gitHubToken}") - } catch(Exception ex) { - println("GitHub Owner and/or Token are empty, you can't run github release task, set them with -PgitHubOwner/-PgitHubToken options") +task prepareReleaseData { + doLast { + try { + println("${gitHubOwner}") + println("${gitHubToken}") + } catch(Exception ex) { + println("GitHub Owner and/or Token are empty, you can't run github release task, set them with -PgitHubOwner/-PgitHubToken options") + } } } prepareReleaseData.dependsOn nugetPack -task configureCustomGitHubRelease () << { - github { - owner = "${gitHubOwner}" - repo = 'callfire-api-client-csharp' - token = "${gitHubToken}" - tagName = project.version - targetCommitish = 'master' - name = project.version - body = releaseDescription() - assets = [ - 'build/dist/CallfireApiClient-' + project.version + '.zip', - 'build/dist/CallfireApiClient.' + project.version + '.nupkg' - ] +task configureCustomGitHubRelease { + doLast { + github { + owner = "${gitHubOwner}" + repo = 'callfire-api-client-csharp' + token = "${gitHubToken}" + tagName = project.version + targetCommitish = 'master' + name = project.version + body = releaseDescription() + assets = [ + 'build/dist/CallfireApiClient-' + project.version + '.zip', + 'build/dist/CallfireApiClient.' + project.version + '.nupkg' + ] + } } } configureCustomGitHubRelease.dependsOn prepareReleaseData @@ -206,4 +214,4 @@ def releaseDescription() { String secondVersionEntry = releaseNotes.find(~/Version.*/) String currentReleaseChanges = releaseNotes.substring(0, (secondVersionEntry == null ? releaseNotes.size() - 1 : releaseNotes.indexOf(secondVersionEntry))).trim() "$currentReleaseChanges" -} \ No newline at end of file +} diff --git a/src/CallfireApiClient.IntegrationTests/Api/CallsTexts/CallsApiIntegrationTest.cs b/src/CallfireApiClient.IntegrationTests/Api/CallsTexts/CallsApiIntegrationTest.cs index 0f4563f..744d13b 100644 --- a/src/CallfireApiClient.IntegrationTests/Api/CallsTexts/CallsApiIntegrationTest.cs +++ b/src/CallfireApiClient.IntegrationTests/Api/CallsTexts/CallsApiIntegrationTest.cs @@ -115,7 +115,7 @@ public void GetCallRecordings() recs = Client.CallsApi.GetCallRecordings((long)rec.CallId, "items(callId)"); Assert.Null(recs[0].Id); - Assert.Null(recs[0].CallId); + Assert.NotNull(recs[0].CallId); } [Test] @@ -131,7 +131,7 @@ public void GetCallRecordingByName() recording = Client.CallsApi.GetCallRecordingByName((long)rec.CallId, rec.Name, "callId"); Assert.Null(recording.Id); - Assert.Null(recording.CallId); + Assert.NotNull(recording.CallId); } [Test] diff --git a/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs b/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs index 8264614..e5a5baf 100644 --- a/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs +++ b/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs @@ -127,15 +127,34 @@ public void StartStopArchiveCampaign() [Test] public void GetBroadcastCalls() { - var getCallsRequest = new GetByIdRequest { Id = 1 }; + var broadcast = new CallBroadcast + { + Name = "call_broadcast", + AnsweringMachineConfig = AnsweringMachineConfig.AM_AND_LIVE, + Sounds = new CallBroadcastSounds + { + LiveSoundText = "Hello! This is a live answer text to speech recording", + LiveSoundTextVoice = Voice.MALE1, + MachineSoundText = "This is an answering machine text to speech recording", + MachineSoundTextVoice = Voice.MALE1 + }, + Recipients = new List + { + new Recipient { PhoneNumber = "12132041238" }, + new Recipient { PhoneNumber = "14246525473" } + } + }; + var id = Client.CallBroadcastsApi.Create(broadcast, false); + + var getCallsRequest = new GetByIdRequest { Id = id.Id }; var calls = Client.CallBroadcastsApi.GetCalls(getCallsRequest); System.Console.WriteLine(calls); Assert.That(calls.Items, Is.Not.Empty); long testBatchId = (long) calls.Items[0].BatchId; - getCallsRequest = new GetBroadcastCallsTextsRequest { Id = 1, BatchId = testBatchId }; - calls = Client.CallBroadcastsApi.GetCalls(getCallsRequest); + var getCallsRequestNew = new GetBroadcastCallsTextsRequest { Id = id.Id, BatchId = testBatchId }; + calls = Client.CallBroadcastsApi.GetCalls(getCallsRequestNew); System.Console.WriteLine(calls); Assert.AreEqual(calls.Items[0].BatchId, testBatchId); } diff --git a/src/CallfireApiClient.Tests/CallfireApiClient.Tests.csproj b/src/CallfireApiClient.Tests/CallfireApiClient.Tests.csproj index 22ad72a..756c423 100644 --- a/src/CallfireApiClient.Tests/CallfireApiClient.Tests.csproj +++ b/src/CallfireApiClient.Tests/CallfireApiClient.Tests.csproj @@ -32,6 +32,9 @@ false + + ..\..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll + @@ -40,9 +43,6 @@ ..\..\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll - - ..\..\packages\DotNetZip.1.9.7\lib\net20\Ionic.Zip.dll - diff --git a/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getBillingPlanUsage.json b/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getBillingPlanUsage.json index 7fb833c..60cf23b 100644 --- a/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getBillingPlanUsage.json +++ b/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getBillingPlanUsage.json @@ -1,7 +1,7 @@ { "intervalStart": 1000000000000, "intervalEnd": 1000000000000, - "remainingPlanCredits": 0.0000, - "remainingPayAsYouGoCredits": 2015.0000, - "totalRemainingCredits": 2015.0000 + "remainingPlanCredits": 0.0, + "remainingPayAsYouGoCredits": 2015.0, + "totalRemainingCredits": 2015.0 } \ No newline at end of file diff --git a/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getCreditsUsage.json b/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getCreditsUsage.json index 8ede628..ad459c2 100644 --- a/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getCreditsUsage.json +++ b/src/CallfireApiClient.Tests/JsonMocks/account/meApi/response/getCreditsUsage.json @@ -3,5 +3,5 @@ "intervalEnd": 1000000000000, "callsDurationMinutes": 100, "textsSent": 2015, - "creditsUsed": 2015.000 + "creditsUsed": 2015.0 } diff --git a/src/CallfireApiClient.Tests/JsonMocks/campaigns/callBroadcastsApi/response/getStats.json b/src/CallfireApiClient.Tests/JsonMocks/campaigns/callBroadcastsApi/response/getStats.json index d621033..7c41d0f 100644 --- a/src/CallfireApiClient.Tests/JsonMocks/campaigns/callBroadcastsApi/response/getStats.json +++ b/src/CallfireApiClient.Tests/JsonMocks/campaigns/callBroadcastsApi/response/getStats.json @@ -1,7 +1,7 @@ { "totalOutboundCount": 3, "remainingOutboundCount": 0, - "billedAmount": 0.0000, + "billedAmount": 0.0, "callsAttempted": 3, "callsPlaced": 3, "callsDuration": 0, diff --git a/src/CallfireApiClient.Tests/JsonMocks/campaigns/textBroadcastsApi/response/getStats.json b/src/CallfireApiClient.Tests/JsonMocks/campaigns/textBroadcastsApi/response/getStats.json index e4ef2d5..8ee5c38 100644 --- a/src/CallfireApiClient.Tests/JsonMocks/campaigns/textBroadcastsApi/response/getStats.json +++ b/src/CallfireApiClient.Tests/JsonMocks/campaigns/textBroadcastsApi/response/getStats.json @@ -1,7 +1,7 @@ { "totalOutboundCount": 6, "remainingOutboundCount": 0, - "billedAmount": 0.0000, + "billedAmount": 0.0, "sentCount": 0, "unsentCount": 0, "recievedCount": 0, diff --git a/src/CallfireApiClient.Tests/packages.config b/src/CallfireApiClient.Tests/packages.config index b0dbf33..88d65d2 100644 --- a/src/CallfireApiClient.Tests/packages.config +++ b/src/CallfireApiClient.Tests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/src/CallfireApiClient/CallfireApiClient.csproj b/src/CallfireApiClient/CallfireApiClient.csproj index 31ab939..23b3f3a 100644 --- a/src/CallfireApiClient/CallfireApiClient.csproj +++ b/src/CallfireApiClient/CallfireApiClient.csproj @@ -33,15 +33,15 @@ bin\Release\callfire-api-client.xml + + ..\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll + ..\..\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll - - ..\..\packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll - diff --git a/src/CallfireApiClient/Properties/AssemblyInfo.cs b/src/CallfireApiClient/Properties/AssemblyInfo.cs index daff52e..4631343 100644 --- a/src/CallfireApiClient/Properties/AssemblyInfo.cs +++ b/src/CallfireApiClient/Properties/AssemblyInfo.cs @@ -13,7 +13,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.17.*")] +[assembly: AssemblyVersion("1.1.18.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. diff --git a/src/CallfireApiClient/packages.config b/src/CallfireApiClient/packages.config index 26aa0f0..d127454 100644 --- a/src/CallfireApiClient/packages.config +++ b/src/CallfireApiClient/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file