From 593e6947b6dc32d798a50d27ad91d928667fa675 Mon Sep 17 00:00:00 2001 From: vmalinovskiy Date: Mon, 11 Jul 2016 17:19:59 +0300 Subject: [PATCH 1/3] vmalinovskiy: fixed integration test for checking Start/Stop/Archive campaign operation --- .../CallBroadcastsApiIntegrationTest.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs b/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs index c7f7a31..4d2f6f1 100644 --- a/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs +++ b/src/CallfireApiClient.IntegrationTests/Api/Campaigns/CallBroadcastsApiIntegrationTest.cs @@ -80,7 +80,26 @@ public void IvrsCrudOperations() [Test] public void StartStopArchiveCampaign() { - CallBroadcast campaign = Client.CallBroadcastsApi.Get(8729046003); + 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, true); + + CallBroadcast campaign = Client.CallBroadcastsApi.Get(id.Id); Console.WriteLine(campaign); Assert.NotNull(campaign); // start From a2111750962fb2755cd927b89cd6687fefccde0a Mon Sep 17 00:00:00 2001 From: vmalinovskiy Date: Wed, 13 Jul 2016 16:41:26 +0300 Subject: [PATCH 2/3] vmalinovskiy: fixed gradle build config formatting --- build.gradle | 138 +++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/build.gradle b/build.gradle index d640991..6c12abc 100644 --- a/build.gradle +++ b/build.gradle @@ -32,16 +32,16 @@ nuget { msbuild.dependsOn nugetRestore msbuild { - solutionFile = 'callfire-api-client-csharp.sln' - configuration = buildReleaseConfiguration - projectName = 'CallfireApiClient' - generateDoc = true + solutionFile = 'callfire-api-client-csharp.sln' + configuration = buildReleaseConfiguration + projectName = 'CallfireApiClient' + generateDoc = true } task msbuildDebug (type: com.ullink.Msbuild) { - solutionFile = 'callfire-api-client-csharp.sln' - configuration = buildDebugConfiguration - projectName = 'CallfireApiClient' + solutionFile = 'callfire-api-client-csharp.sln' + configuration = buildDebugConfiguration + projectName = 'CallfireApiClient' } msbuildDebug.dependsOn nunit @@ -60,25 +60,25 @@ task updateNuspecFile << { // 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"] } - } - } - + 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"] } + } + } + spec.files.appendNode { - file(src: "src/**/*.cs", target: 'src') {} + 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') {} + if (isWindowsOs) { + file(src: "$assemblyBinDebugDir/${archivesBaseName}.pdb", target: 'lib') {} + } + file(src: "$assemblyBinDebugDir/${archivesBaseName}.dll.mdb", target: 'lib') {} } def fw = new FileWriter('CallfireApiClient.nuspec') @@ -123,71 +123,71 @@ 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) {} - } - } - def fw = new FileWriter('src/CallfireApiClient.IntegrationTests/App.config') + 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() } task msbuildForIntegrationTests (type: com.ullink.Msbuild) { - solutionFile = 'callfire-api-client-csharp.sln' - configuration = buildReleaseConfiguration - projectName = 'CallfireApiClient' + solutionFile = 'callfire-api-client-csharp.sln' + configuration = buildReleaseConfiguration + projectName = 'CallfireApiClient' } msbuildForIntegrationTests.dependsOn prepareTestData task integrationTests (type: com.ullink.gradle.nunit.NUnit) { - testAssemblies = [ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ] + testAssemblies = [ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ] } 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") - } + 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 = file('CurrentReleaseChanges.txt').text - assets = [ - 'build/dist/CallfireApiClient-' + project.version + '.zip', - 'build/dist/CallfireApiClient.' + project.version + '.nupkg' - ] - } + github { + owner = "${gitHubOwner}" + repo = 'callfire-api-client-csharp' + token = "${gitHubToken}" + tagName = project.version + targetCommitish = 'master' + name = project.version + body = file('CurrentReleaseChanges.txt').text + assets = [ + 'build/dist/CallfireApiClient-' + project.version + '.zip', + 'build/dist/CallfireApiClient.' + project.version + '.nupkg' + ] + } } configureCustomGitHubRelease.dependsOn prepareReleaseData githubRelease.dependsOn configureCustomGitHubRelease From 1fd9a80c2674e40c20333da0e81348cb60fa034e Mon Sep 17 00:00:00 2001 From: vmalinovskiy Date: Wed, 13 Jul 2016 21:33:13 +0300 Subject: [PATCH 3/3] vmalinovskiy: gradle script for automatic release updated to parse release description from Changelog --- CallfireApiClient.nuspec | 56 +++++++++++++++++++-------------------- Changelog.txt | 51 ++++++++++++++++++----------------- CurrentReleaseChanges.txt | 1 - build.gradle | 10 ++++++- 4 files changed, 63 insertions(+), 55 deletions(-) delete mode 100644 CurrentReleaseChanges.txt diff --git a/CallfireApiClient.nuspec b/CallfireApiClient.nuspec index 0b13bd0..26dc2bb 100644 --- a/CallfireApiClient.nuspec +++ b/CallfireApiClient.nuspec @@ -4,9 +4,9 @@ 1.1.9 CallFire API v2 client - Vladimir Mikhailov - Vladimir Malinovskiy - + Vladimir Mikhailov + Vladimir Malinovskiy + CallFire Inc. https://github.com/CallFire/callfire-api-client-csharp https://github.com/CallFire/callfire-api-client-csharp/blob/master/LICENSE @@ -16,50 +16,50 @@ Callfire API client Changelog ============================= Version 1.1.9 - Jul 11 2016 - - added loading labels parameter in Number Lease objects +- 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 +- 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 +- 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 +- 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 +- 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. +- 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. +- 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 +- 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 - - default policy set to ignore unknown json fields on deserializing +- default policy set to ignore unknown json fields on deserializing Version 1.1.0 - Jan 11 2016 - - added Subscriptions API +- added Subscriptions API Version 1.0.0 - Dec 29 2015 - - initial release +- initial release Copyright (c) 2015 CallFire Inc. Callfire rest api client diff --git a/Changelog.txt b/Changelog.txt index d42bdf5..5064531 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,47 +1,48 @@ Callfire API client Changelog ============================= Version 1.1.9 - Jul 11 2016 - - added loading labels parameter in Number Lease objects +- 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 +- 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 +- 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 +- 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 +- 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. +- 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. +- 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 +- 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 - - default policy set to ignore unknown json fields on deserializing +- default policy set to ignore unknown json fields on deserializing Version 1.1.0 - Jan 11 2016 - - added Subscriptions API +- added Subscriptions API Version 1.0.0 - Dec 29 2015 - - initial release +- initial release diff --git a/CurrentReleaseChanges.txt b/CurrentReleaseChanges.txt deleted file mode 100644 index 5d629ed..0000000 --- a/CurrentReleaseChanges.txt +++ /dev/null @@ -1 +0,0 @@ -- added loading labels parameter in Number Lease objects diff --git a/build.gradle b/build.gradle index 6c12abc..68b138b 100644 --- a/build.gradle +++ b/build.gradle @@ -182,7 +182,7 @@ task configureCustomGitHubRelease () << { tagName = project.version targetCommitish = 'master' name = project.version - body = file('CurrentReleaseChanges.txt').text + body = releaseDescription() assets = [ 'build/dist/CallfireApiClient-' + project.version + '.zip', 'build/dist/CallfireApiClient.' + project.version + '.nupkg' @@ -196,4 +196,12 @@ githubRelease.dependsOn configureCustomGitHubRelease nugetPush { apiKey = System.properties[ 'NUGET_API_KEY' ] ?: "key not set" nupkgFile = nugetPack.packageFile +} + +def releaseDescription() { + String releaseNotes = file("Changelog.txt").text + Integer start = releaseNotes.indexOf("Version") + 28; + Integer end = releaseNotes.indexOf("Version", start); + String currentReleaseChanges = releaseNotes.substring(start, end).trim() + "$currentReleaseChanges" } \ No newline at end of file