From b9d1a22577270cc34babd89803be07b771c97d76 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Fri, 14 Jul 2023 18:51:08 +0530 Subject: [PATCH 1/2] SMS-6010: Add DLT Params to Send and Get Message APIs --- src/Plivo/Resource/Message/Message.cs | 23 +++- .../Resource/Message/MessageInterface.cs | 74 ++++++++++--- .../Plivo.Test/Mocks/messageGetResponse.json | 5 +- .../Plivo.Test/Mocks/messageListResponse.json | 100 ++++++++++++++---- 4 files changed, 166 insertions(+), 36 deletions(-) diff --git a/src/Plivo/Resource/Message/Message.cs b/src/Plivo/Resource/Message/Message.cs index 63e5387c..23c4d0aa 100755 --- a/src/Plivo/Resource/Message/Message.cs +++ b/src/Plivo/Resource/Message/Message.cs @@ -123,6 +123,24 @@ public class Message : Resource /// The replaced sender. public string ReplacedSender { get; set; } + /// + /// Gets or sets the dlt entity id. + /// + /// DLT Entity ID. + public string DltEntityId { get; set; } + + /// + /// Gets or sets the dlt template id. + /// + /// DLT Template ID. + public string DltTemplateId { get; set; } + + /// + /// Gets or sets the dlt template category. + /// + /// DLT Template Category. + public string DltTemplateCategory { get; set; } + public override string ToString() { return "\n" + @@ -145,7 +163,10 @@ public override string ToString() "TendlcRegistrationStatus: "+ TendlcRegistrationStatus + "\n" + "RequesterIP: " + RequesterIp + "\n" + "IsDomestic: " + IsDomestic + "\n" + - "ReplacedSender: " + ReplacedSender + "\n"; + "ReplacedSender: " + ReplacedSender + "\n" + + "DLTEntityID: " + DltEntityId + "\n" + + "DLTTemplateID: " + DltTemplateId + "\n" + + "DLTTemplateCategory: " + DltTemplateCategory + "\n"; } #region ListMedia /// diff --git a/src/Plivo/Resource/Message/MessageInterface.cs b/src/Plivo/Resource/Message/MessageInterface.cs index e2513bcd..321e5530 100755 --- a/src/Plivo/Resource/Message/MessageInterface.cs +++ b/src/Plivo/Resource/Message/MessageInterface.cs @@ -36,11 +36,16 @@ public MessageInterface(HttpClient client) : base(client) /// Log. /// trackable. /// powerpackUUID - ///media_urls - ///media_ids + /// media_urls + /// media_ids + /// dlt_entity_id + /// dlt_template_id + /// dlt_template_category public MessageCreateResponse Create( List dst, string text = null, string src = null, string type = null, - string url = null, string method = null, bool? log = null, bool? trackable = null, string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null) + string url = null, string method = null, bool? log = null, bool? trackable = null, + string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null, + string dlt_entity_id = null, string dlt_template_id = null, string dlt_template_category = null) { string _dst = string.Join("<", dst); @@ -61,7 +66,10 @@ public MessageCreateResponse Create( log, trackable, media_urls, - media_ids + media_ids, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); } else if (powerpack_uuid != null && src == null) @@ -79,7 +87,10 @@ public MessageCreateResponse Create( log, trackable, media_urls, - media_ids + media_ids, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); @@ -116,9 +127,14 @@ public MessageCreateResponse Create( /// powerpackUUID ///media_urls ///media_ids + /// dlt_entity_id + /// dlt_template_id + /// dlt_template_category public async Task CreateAsync( List dst, string text = null, string src = null, string type = null, - string url = null, string method = null, bool? log = null, bool? trackable = null, string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null) + string url = null, string method = null, bool? log = null, bool? trackable = null, + string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null, + string dlt_entity_id = null, string dlt_template_id = null, string dlt_template_category = null) { string _dst = string.Join("<", dst); @@ -139,7 +155,10 @@ public async Task CreateAsync( log, trackable, media_urls, - media_ids + media_ids, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); } else if (powerpack_uuid != null && src == null) @@ -157,7 +176,10 @@ public async Task CreateAsync( log, trackable, media_urls, - media_ids + media_ids, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); @@ -196,9 +218,15 @@ public async Task CreateAsync( ///media_urls ///media_ids ///message_expiry + /// dlt_entity_id + /// dlt_template_id + /// dlt_template_category public MessageCreateResponse Create( string dst, string text = null, string src = null, string type = null, - string url = null, string method = null, bool? log = null, bool? trackable = null, string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null, uint? message_expiry = null) + string url = null, string method = null, bool? log = null, bool? trackable = null, + string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null, + uint? message_expiry = null, string dlt_entity_id = null, string dlt_template_id = null, + string dlt_template_category = null) { string _dst = dst; Dictionary data = null; @@ -219,7 +247,10 @@ public MessageCreateResponse Create( trackable, media_urls, media_ids, - message_expiry + message_expiry, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); } else if (powerpack_uuid != null && src == null) @@ -238,7 +269,10 @@ public MessageCreateResponse Create( trackable, media_urls, media_ids, - message_expiry + message_expiry, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); @@ -276,9 +310,15 @@ public MessageCreateResponse Create( ///media_urls ///media_ids ///message_expiry + /// dlt_entity_id + /// dlt_template_id + /// dlt_template_category public async Task CreateAsync( string dst, string text = null, string src = null, string type = null, - string url = null, string method = null, bool? log = null, bool? trackable = null, string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null, uint? message_expiry = null) + string url = null, string method = null, bool? log = null, bool? trackable = null, + string powerpack_uuid = null, string[] media_urls = null, string[] media_ids = null, + uint? message_expiry = null, string dlt_entity_id = null, string dlt_template_id = null, + string dlt_template_category = null) { string _dst = dst; Dictionary data = null; @@ -299,7 +339,10 @@ public async Task CreateAsync( trackable, media_urls, media_ids, - message_expiry + message_expiry, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); } else if (powerpack_uuid != null && src == null) @@ -318,7 +361,10 @@ public async Task CreateAsync( trackable, media_urls, media_ids, - message_expiry + message_expiry, + dlt_entity_id, + dlt_template_id, + dlt_template_category }); diff --git a/tests/Plivo.Test/Mocks/messageGetResponse.json b/tests/Plivo.Test/Mocks/messageGetResponse.json index d92a4852..8a9c7509 100755 --- a/tests/Plivo.Test/Mocks/messageGetResponse.json +++ b/tests/Plivo.Test/Mocks/messageGetResponse.json @@ -11,5 +11,8 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "1111", + "dlt_template_id": "2222", + "dlt_template_category": "promotional" } diff --git a/tests/Plivo.Test/Mocks/messageListResponse.json b/tests/Plivo.Test/Mocks/messageListResponse.json index dc922be3..27f0618f 100755 --- a/tests/Plivo.Test/Mocks/messageListResponse.json +++ b/tests/Plivo.Test/Mocks/messageListResponse.json @@ -20,7 +20,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "3333", + "dlt_template_id": "4444", + "dlt_template_category": "transactional" }, { "error_code": null, @@ -34,7 +37,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -48,7 +54,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -62,7 +71,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -76,7 +88,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -90,7 +105,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -104,7 +122,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -118,7 +139,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -132,7 +156,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -146,7 +173,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -160,7 +190,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -174,7 +207,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -188,7 +224,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -202,7 +241,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -216,7 +258,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": null, @@ -230,7 +275,10 @@ "to_number": "911231231231", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -244,7 +292,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -258,7 +309,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -272,7 +326,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" }, { "error_code": "000", @@ -286,7 +343,10 @@ "to_number": "919876543210", "total_amount": "0.00250", "total_rate": "0.00250", - "units": 1 + "units": 1, + "dlt_entity_id": "", + "dlt_template_id": "", + "dlt_template_category": "" } ] } From 19cb66b6db30341335747465db8ba58085c32e54 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Thu, 3 Aug 2023 14:34:55 +0530 Subject: [PATCH 2/2] Version update --- CHANGELOG.md | 5 +++++ Makefile | 6 +++++- README.md | 4 ++-- src/Plivo/Plivo.csproj | 2 +- src/Plivo/Plivo.nuspec | 3 ++- src/Plivo/Version.cs | 2 +- version.json | 2 +- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5181733..ec8350c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [v5.32.0](https://github.com/plivo/plivo-dotnet/tree/v5.32.0) (2023-08-03) +**Feature - DLT parameters** +- Added new params `DLTEntityID`, `DLTTemplateID`, `DLTTemplateCategory` to the [send message API](https://www.plivo.com/docs/sms/api/message/send-a-message/) +- Added new params `DLTEntityID`, `DLTTemplateID`, `DLTTemplateCategory` 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.31.0](https://github.com/plivo/plivo-dotnet/tree/v5.31.0) (2023-06-28) **Feature - Streaming API and XML** - Added Stream API endpoints diff --git a/Makefile b/Makefile index cfcd7501..3e009415 100644 --- a/Makefile +++ b/Makefile @@ -6,4 +6,8 @@ build: 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 + (cd /usr/src/app/dotnet-sdk-test/ && dotnet run Program.cs) + +start: + docker-compose up --build --remove-orphans --detach + docker attach $(shell docker-compose ps -q dotnetSDK) \ No newline at end of file diff --git a/README.md b/README.md index fb09da6a..fedfb0ea 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 5.31.0 +PM> Install-Package Plivo -Version 5.32.0 ``` You can also use the .NET CLI to install this package as follows ``` -> dotnet add package Plivo --version 5.31.0 +> dotnet add package Plivo --version 5.32.0 ``` ## Getting started diff --git a/src/Plivo/Plivo.csproj b/src/Plivo/Plivo.csproj index 356e002a..e5bd6a43 100644 --- a/src/Plivo/Plivo.csproj +++ b/src/Plivo/Plivo.csproj @@ -1,7 +1,7 @@ netstandard2.0;netstandard1.3 - 5.31.0 + 5.32.0 Plivo SDKs Team Plivo Inc. diff --git a/src/Plivo/Plivo.nuspec b/src/Plivo/Plivo.nuspec index e6711417..ac616ce0 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.31.0 + 5.32.0 Plivo Plivo SDKs Team Plivo, Inc. @@ -12,6 +12,7 @@ http://github.com/plivo/plivo-dotnet false + * 5.32.0 Added New Params `DLTEntityID`, `DLTTemplateID`, `DLTTemplateCategory`. * 5.31.0 Added functionality to start, stop and fetch audio streams * 5.30.0 Added New Param 'cnam_lookup' in to the response of the [list all numbers API], [list single number API] * 5.29.0 Added New Param 'cnam_lookup_number_config' in GetCall and ListCalls diff --git a/src/Plivo/Version.cs b/src/Plivo/Version.cs index ff096991..ecee0fe9 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.31.0"; + public const string SdkVersion = "5.32.0"; /// /// Plivo API version /// diff --git a/version.json b/version.json index 53269aac..98c7776c 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "5.31.0", + "version": "5.32.0", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v\\d+(?:\\.\\d+)?$"