diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d61a0ec..a19243f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ -# Change Log +<<<<<<< HEAD +# Change Log] +## [v5.24.1](https://github.com/plivo/plivo-dotnet/tree/v5.23.1) (2023-04-04) +- Added `MonthlyRecordingStorageAmount`, `RecordingStorageRate`, `RoundedRecordingDuration`, and `RecordingStorageDuration` parameters to the response for [get single recording API](https://www.plivo.com/docs/voice/api/recording#retrieve-a-recording) and [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) +- Added `RecordingStorageDuration` parameter as a filter option for [get all recordings API](https://www.plivo.com/docs/voice/api/recording#list-all-recordings) + +## [v5.24.0](https://github.com/plivo/plivo-dotnet/tree/v5.23.0) (2023-17-03) +- Added New Param `CreatedAt` to the response for the [list all profiles API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-all-profiles) and the [get profile API](https://www.plivo.com/docs/sms/api/10dlc/profile#retrieve-a-specific-profile) and the [list all brands API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-all-brands) and the [get brand API](https://www.plivo.com/docs/sms/api/10dlc/brand#retrieve-a-specific-brand) and the [list all campaigns API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-all-campaigns) and the [get campaign API](https://www.plivo.com/docs/sms/api/10dlc/campaign#retrieve-a-specific-campaign) + +## [v5.23.0](https://github.com/plivo/plivo-dotnet/tree/v5.23.0) (2023-03-03) +- Added new param `IsDomestic` to the response for the [list all messages API](https://www.plivo.com/docs/sms/api/message/list-all-messages/) and the [get message details API](https://www.plivo.com/docs/sms/api/message#retrieve-a-message) + ## [v5.22.0](https://github.com/plivo/plivo-dotnet/tree/v5.22.0) (2023-02-23) - Enhance MDR filtering capabilities diff --git a/Dockerfile b/Dockerfile index 542c7c96..3cf7f12f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:latest WORKDIR /usr/src/app -RUN apt-get update && apt-get install -y wget git vim +RUN apt-get update && apt-get install -y wget git vim make RUN apt-get install -y apt-transport-https # Install dotnet sdk and runtime: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install diff --git a/Makefile b/Makefile index 6132f765..cfcd7501 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,9 @@ -.PHONY: build +.PHONY: build run build: - docker-compose up --build --remove-orphans \ No newline at end of file + docker-compose up --build --remove-orphans + +run: + @[ "${CONTAINER}" ] && \ + (docker exec -it $$CONTAINER /bin/bash -c 'cd /usr/src/app/dotnet-sdk-test/ && dotnet run Program.cs') || \ + (cd /usr/src/app/dotnet-sdk-test/ && dotnet run Program.cs) \ No newline at end of file diff --git a/README.md b/README.md index 1eda3af5..34c2cf13 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ You can install this SDK either by referencing the .dll file or using NuGet. Use the following line to install the latest SDK using the NuGet CLI. ``` -PM> Install-Package Plivo -Version 4.2.5 +PM> Install-Package Plivo -Version 5.23.1 ``` You can also use the .NET CLI to install this package as follows ``` -> dotnet add package Plivo --version 4.2.5 +> dotnet add package Plivo --version 5.23.1 ``` ## Getting started @@ -141,4 +141,10 @@ export PLIVO_API_PROD_HOST= (or `/usr/src/app/dotnet-sdk-test/Program.cs` in container) 5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container. However, when any change is made, the dependencies for the test program need to be re-installed. To do that: * Either restart the docker container - * Or Run the `setup_sdk.sh` script \ No newline at end of file + * Or Run the `setup_sdk.sh` script +6. To run test code, run `make run CONTAINER=` in host. +> `` is the docker container id created in 2. +(The docker container should be running) + +> Test code can also be run within the container using +`make run`. (`CONTAINER` argument should be omitted when running from the container) \ No newline at end of file diff --git a/setup_sdk.sh b/setup_sdk.sh index f842d38b..ae741b52 100755 --- a/setup_sdk.sh +++ b/setup_sdk.sh @@ -18,6 +18,9 @@ find /usr/src/app/src/Plivo/Client -type f -exec sed -i "s/$PLIVO_API_PROD_HOST/ if [ ! -d $testDir ]; then echo "Creating test dir..." mkdir -p $testDir +fi + +if [[ $( grep "Plivo.NetCore.Test" Plivo.sln ) ]]; then # Fix for library issue: See Dotnet section of https://plivo-team.atlassian.net/wiki/spaces/SMSTEAM/pages/3581313044/Local+Setup+for+SDKs sed -i '/Nerdbank.GitVersioning/ { n; @@ -38,12 +41,15 @@ if [ ! -f $testDir/*.csproj ]; then dotnet restore fi -echo -e "\n\nSDK setup complete!" -echo "To test your changes:" -echo -e "\t1. Add your test code to /$testDir/Program.cs on host (or /usr/src/app/$testDir/Program.cs in the container)" -echo -e "\t2. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC" -echo -e "\t3. Navigate to the test directory: $GREEN cd /usr/src/app/$testDir$NC" -echo -e "\t4. Run your test file: $GREEN dotnet run Program.cs$NC" +echo -e "\n\nSDK setup complete! You can test changes either on host or inside the docker container:" +echo -e "\ta.To test your changes ON HOST:" +echo -e "\t\t1. Add your test code to /$testDir/Program.cs" +echo -e "\t\t2. Run your test file using: $GREEN make run CONTAINER=$HOSTNAME$NC" +echo +echo -e "\tb. To test your changes INSIDE CONTAINER:" +echo -e "\t\t1. Run a terminal in the container using: $GREEN docker exec -it $HOSTNAME /bin/bash$NC" +echo -e "\t\t2. Add your test code in /usr/src/app/$testDir/Program.cs" +echo -e "\t\t3. Run your test file using: $GREEN make run$NC" # To keep the container running post setup /bin/bash \ No newline at end of file diff --git a/src/Plivo/Plivo.csproj b/src/Plivo/Plivo.csproj index 6f2a0795..982813e0 100644 --- a/src/Plivo/Plivo.csproj +++ b/src/Plivo/Plivo.csproj @@ -1,7 +1,7 @@ netstandard2.0;netstandard1.3 - 5.22.0 + 5.24.1 Plivo SDKs Team Plivo Inc. diff --git a/src/Plivo/Plivo.nuspec b/src/Plivo/Plivo.nuspec index b629f0ab..090a3a02 100644 --- a/src/Plivo/Plivo.nuspec +++ b/src/Plivo/Plivo.nuspec @@ -4,7 +4,7 @@ A .NET SDK to make voice calls and send SMS using Plivo and to generate Plivo XML A .NET SDK to make voice calls and send SMS using Plivo and to generate Plivo XML Plivo - 5.21.0 + 5.24.1 Plivo Plivo SDKs Team Plivo, Inc. @@ -12,6 +12,9 @@ http://github.com/plivo/plivo-dotnet false + * 5.24.1 Added new Params 'MonthlyRecordingStorageAmount', 'RecordingStorageRate', 'RecordingStorageDuration' and 'RoundedRecordingDuration' to List Recordings and Get Recording APIs + * 5.24.0 Added New Param 'CreatedAt' to List Profiles, Get Profile, List Brands, Get Brand, List Campaigns, Get Campaign APIs + * 5.23.0 Added New Param 'IsDomestic' to List Message and Get Message APIs * 5.22.0 Added New Params to List Message and Get Message APIs * 5.21.0 Added New Param 'RequesterIp' to List Message and Get Message APIs * 5.19.0 Added Update campaign endpoints diff --git a/src/Plivo/Resource/Brand/Brand.cs b/src/Plivo/Resource/Brand/Brand.cs index 9bc2b939..189713b8 100644 --- a/src/Plivo/Resource/Brand/Brand.cs +++ b/src/Plivo/Resource/Brand/Brand.cs @@ -46,6 +46,9 @@ public class BrandResponse [JsonProperty("address")] public Address Address { get; set; } + + [JsonProperty("created_at")] + public string CreatedAt { get; set; } } @@ -159,6 +162,9 @@ public class ListBrands: Resource [JsonProperty("vetting_status")] public string VettingStatus { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + [JsonProperty("address")] public Address Address { get; set; } diff --git a/src/Plivo/Resource/Campaign/Campaign.cs b/src/Plivo/Resource/Campaign/Campaign.cs index adde71f4..3aabf21c 100644 --- a/src/Plivo/Resource/Campaign/Campaign.cs +++ b/src/Plivo/Resource/Campaign/Campaign.cs @@ -98,7 +98,8 @@ public class CampaignResponse [JsonProperty("help_keywords")] public string HelpKeywords { get; set; } - + [JsonProperty("created_at")] + public string CreatedAt { get; set; } } [JsonObject(MemberSerialization.OptIn)] @@ -203,6 +204,9 @@ public class ListCampaigns: Resource [JsonProperty("help_keywords")] public string HelpKeywords { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + public override string ToString() { return JsonConvert.SerializeObject(this, Formatting.Indented); diff --git a/src/Plivo/Resource/Message/Message.cs b/src/Plivo/Resource/Message/Message.cs index 1e5f0fad..85abe87d 100755 --- a/src/Plivo/Resource/Message/Message.cs +++ b/src/Plivo/Resource/Message/Message.cs @@ -111,6 +111,12 @@ public class Message : Resource /// The requester ip. public string RequesterIp { get; set; } + /// + /// Gets or sets the is domestic. + /// + /// The is domestic. + public bool? IsDomestic { get; set; } + public override string ToString() { return "\n" + @@ -131,7 +137,8 @@ public override string ToString() "DestinationCountryIso2: " + DestinationCountryIso2 + "\n" + "TendlcCampaignId: " + TendlcCampaignId + "\n" + "TendlcRegistrationStatus: "+ TendlcRegistrationStatus + "\n" + - "RequesterIP: " + RequesterIp + "\n"; + "RequesterIP: " + RequesterIp + "\n" + + "IsDomestic: " + IsDomestic + "\n"; } #region ListMedia /// diff --git a/src/Plivo/Resource/Profile/Profile.cs b/src/Plivo/Resource/Profile/Profile.cs index a92c7a97..26b50b8f 100644 --- a/src/Plivo/Resource/Profile/Profile.cs +++ b/src/Plivo/Resource/Profile/Profile.cs @@ -122,6 +122,9 @@ public class Profile [JsonProperty("plivo_subaccount")] public string PlivoSubaccount { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + } [JsonObject(MemberSerialization.OptIn)] @@ -175,6 +178,9 @@ public class ListProfiles: Resource [JsonProperty("profile_uuid")] public string ProfileUuid { get; set; } + [JsonProperty("created_at")] + public string CreatedAt { get; set; } + [JsonProperty("plivo_subaccount")] public string PlivoSubaccount { get; set; } diff --git a/src/Plivo/Resource/Recording/Recording.cs b/src/Plivo/Resource/Recording/Recording.cs index f90ebcc8..cb8f8eaa 100755 --- a/src/Plivo/Resource/Recording/Recording.cs +++ b/src/Plivo/Resource/Recording/Recording.cs @@ -8,6 +8,8 @@ public class Recording : Resource public string AddTime { get; set; } public string CallUuid { get; set; } public string ConferenceName { get; set; } + public string Cost { get; set; } + public string DaysOfStorage { get; set; } public string RecordingDurationMs { get; set; } public string RecordingEndMs { get; set; } public string RecordingFormat { get; set; } @@ -16,6 +18,7 @@ public class Recording : Resource public string RecordingType { get; set; } public string RecordingUrl { get; set; } public string ResourceUri { get; set; } + public string RoundedDuration { get; set; } public string FromNumber { get; set; } public string ToNumber { get; set; } @@ -25,6 +28,8 @@ public override string ToString() "AddTime: " + AddTime + "\n" + "CallUuid: " + CallUuid + "\n" + "ConferenceName: " + ConferenceName + "\n" + + "Cost: " + Cost + "\n" + + "DaysOfStorage: " + DaysOfStorage + "\n" + "RecordingDurationMs: " + RecordingDurationMs + "\n" + "RecordingEndMs: " + RecordingEndMs + "\n" + "RecordingFormat: " + RecordingFormat + "\n" + @@ -33,6 +38,7 @@ public override string ToString() "RecordingType: " + RecordingType + "\n" + "RecordingUrl: " + RecordingUrl + "\n" + "ResourceUri: " + ResourceUri + "\n" + + "RoundedDuration: " + RoundedDuration + "\n" + "FromNumber: " + FromNumber + "\n" + "ToNumber: " + ToNumber + "\n"; diff --git a/src/Plivo/Resource/Recording/RecordingInterface.cs b/src/Plivo/Resource/Recording/RecordingInterface.cs index 2afc4963..48153bd1 100755 --- a/src/Plivo/Resource/Recording/RecordingInterface.cs +++ b/src/Plivo/Resource/Recording/RecordingInterface.cs @@ -89,11 +89,13 @@ public async Task GetAsync(string recordingId, string callbackUrl /// Mpc Name. /// Conference Uuid. /// mpc Uuid. + /// Rounded duration. public ListResponse List( string fromNumber = null, string toNumber = null, string conferenceName = null, string mpcName = null, string conferenceUuid = null, string mpcUuid = null, - string subaccount = null, string callUuid = null, + string subaccount = null, string callUuid = null, + uint? roundedDuration = null, DateTime? addTime = null, DateTime? addTime_Gt = null, DateTime? addTime_Gte = null, DateTime? addTime_Lt = null, DateTime? addTime_Lte = null, uint? limit = null, @@ -119,6 +121,7 @@ public ListResponse List( mpcUuid, subaccount, callUuid, + roundedDuration, _addTime, _addTime_Gt, _addTime_Gte, @@ -161,11 +164,13 @@ public ListResponse List( /// Mpc Name. /// Conference Uuid. /// mpc Uuid. + /// Rounded duration. public async Task ListAsync( string fromNumber = null, string toNumber = null, string conferenceName = null, string mpcName = null, string conferenceUuid = null, string mpcUuid = null, string subaccount = null, string callUuid = null, + uint? roundedDuration = null, DateTime? addTime = null, DateTime? addTime_Gt = null, DateTime? addTime_Gte = null, DateTime? addTime_Lt = null, DateTime? addTime_Lte = null, uint? limit = null, @@ -191,6 +196,7 @@ public async Task ListAsync( mpcUuid, subaccount, callUuid, + roundedDuration, _addTime, _addTime_Gt, _addTime_Gte, diff --git a/src/Plivo/Version.cs b/src/Plivo/Version.cs index aeda7ea4..f56c7b8c 100644 --- a/src/Plivo/Version.cs +++ b/src/Plivo/Version.cs @@ -10,7 +10,7 @@ public class Version /// /// DotNet SDK version /// - public const string SdkVersion = "5.22.0"; + public const string SdkVersion = "5.24.1"; /// /// Plivo API version /// diff --git a/tests_netcore/Plivo.NetCore.Test/Mocks/recordingGetResponse.json b/tests_netcore/Plivo.NetCore.Test/Mocks/recordingGetResponse.json index 974a7620..b75f8bc8 100755 --- a/tests_netcore/Plivo.NetCore.Test/Mocks/recordingGetResponse.json +++ b/tests_netcore/Plivo.NetCore.Test/Mocks/recordingGetResponse.json @@ -12,5 +12,8 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-11e4-a664-0026b945b52x.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-11e4-a664-0026b945b52x/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } diff --git a/tests_netcore/Plivo.NetCore.Test/Mocks/recordingListResponse.json b/tests_netcore/Plivo.NetCore.Test/Mocks/recordingListResponse.json index 9a025559..44ec2ce1 100755 --- a/tests_netcore/Plivo.NetCore.Test/Mocks/recordingListResponse.json +++ b/tests_netcore/Plivo.NetCore.Test/Mocks/recordingListResponse.json @@ -21,7 +21,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/c2186400-1c8c-1124-a664-0026b945b522.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/c2186400-1c8c-1124-a664-0026b945b522/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 16:05:21.993853+05:30", @@ -36,7 +39,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/fc2716b0-1c8b-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/fc2716b0-1c8b-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" }, { "add_time": "2014-08-05 15:51:56.582492+05:30", @@ -51,7 +57,10 @@ "recording_url": "http://s3.amazonaws.com/recordings_2013/3e701c9e-1c8a-11e4-bwad-842b2b17453e.mp3", "resource_uri": "/v1/Account/MANWVLYTK4ZWU1YTY4ZT/Recording/3e701c9e-1c8a-11e4-bwad-842b2b17453e/", "from_number": "+919999323467", - "to_number": "+919891865130" + "to_number": "+919891865130", + "cost": "0.0004", + "rounded_duration": "120", + "days_of_storage": "209" } ] } diff --git a/version.json b/version.json index fc12d6aa..10d99674 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "5.22.0", + "version": "5.24.0", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v\\d+(?:\\.\\d+)?$"