From 3ef35eba51056fee1b60de3dfde0cc90e1c20fb8 Mon Sep 17 00:00:00 2001 From: Gabriel Odero Date: Wed, 11 Dec 2024 23:52:19 +0300 Subject: [PATCH] Named parameter support #111 --- .../Requests/AuthenticationTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/CatalogTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/CouponCodeTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/DocumentTemplateMessageRequest.cs | 5 ++++- .../Messages/Requests/FlowTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/ImageTemplateMessageRequest.cs | 5 ++++- .../Messages/Requests/InteractiveTemplateMessageRequest.cs | 5 ++++- .../Requests/LimitedTimeOfferTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/LocationTemplateMessageRequest.cs | 5 ++++- .../Messages/Requests/MultiProductTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/SingleProductTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/TextTemplateMessageRequest.cs | 3 +++ .../Messages/Requests/VideoTemplateMessageRequest.cs | 5 ++++- WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj | 2 +- 14 files changed, 45 insertions(+), 6 deletions(-) diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/AuthenticationTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/AuthenticationTemplateMessageRequest.cs index 83fc451..243a3ca 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/AuthenticationTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/AuthenticationTemplateMessageRequest.cs @@ -116,6 +116,9 @@ public class AuthenticationMessageParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("text")] public string Text { get; set; } } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/CatalogTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/CatalogTemplateMessageRequest.cs index f8093db..4693a23 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/CatalogTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/CatalogTemplateMessageRequest.cs @@ -56,6 +56,9 @@ public class CatalogTemplateMessageParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] public string Text { get; set; } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/CouponCodeTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/CouponCodeTemplateMessageRequest.cs index 94321cf..1a5b4cf 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/CouponCodeTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/CouponCodeTemplateMessageRequest.cs @@ -53,6 +53,9 @@ public class CouponCodeMessageParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] public string Text { get; set; } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/DocumentTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/DocumentTemplateMessageRequest.cs index fa7cb13..6f37729 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/DocumentTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/DocumentTemplateMessageRequest.cs @@ -50,7 +50,10 @@ public class DocumentMessageParameter [JsonProperty("type")] public string Type { get; set; } - [JsonProperty("document", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + + [JsonProperty("document", NullValueHandling = NullValueHandling.Ignore)] public Document Document { get; set; } [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/FlowTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/FlowTemplateMessageRequest.cs index dfdde6a..e23ea71 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/FlowTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/FlowTemplateMessageRequest.cs @@ -56,6 +56,9 @@ public class FlowTemplateMessageParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("action", NullValueHandling = NullValueHandling.Ignore)] public FlowTemplateMessageAction Action { get; set; } } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/ImageTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/ImageTemplateMessageRequest.cs index a438aec..0adfbc1 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/ImageTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/ImageTemplateMessageRequest.cs @@ -50,7 +50,10 @@ public class ImageMessageParameter [JsonProperty("type")] public string Type { get; set; } - [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + + [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] public Image Image { get; set; } [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/InteractiveTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/InteractiveTemplateMessageRequest.cs index 30a08a3..26c7b34 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/InteractiveTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/InteractiveTemplateMessageRequest.cs @@ -56,7 +56,10 @@ public class InteractiveMessageParameter [JsonProperty("type")] public string Type { get; set; } - [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + + [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] public InteractiveMessageImage Image { get; set; } [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/LimitedTimeOfferTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/LimitedTimeOfferTemplateMessageRequest.cs index 7e0b47a..109f652 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/LimitedTimeOfferTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/LimitedTimeOfferTemplateMessageRequest.cs @@ -56,6 +56,9 @@ public class LimitedTimeOfferMessageParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] public LimitedTimeOfferMessageImage Image { get; set; } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/LocationTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/LocationTemplateMessageRequest.cs index 66b1d18..bab0df1 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/LocationTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/LocationTemplateMessageRequest.cs @@ -50,7 +50,10 @@ public class LocationMessageParameter [JsonProperty("type")] public string Type { get; set; } - [JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + + [JsonProperty("location", NullValueHandling = NullValueHandling.Ignore)] public LocationDetails Location { get; set; } [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/MultiProductTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/MultiProductTemplateMessageRequest.cs index 8f45aa0..248f877 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/MultiProductTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/MultiProductTemplateMessageRequest.cs @@ -56,6 +56,9 @@ public class MPMParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] public string Text { get; set; } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/SingleProductTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/SingleProductTemplateMessageRequest.cs index 346d413..0958a08 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/SingleProductTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/SingleProductTemplateMessageRequest.cs @@ -59,6 +59,9 @@ public class SPMParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] public string Text { get; set; } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/TextTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/TextTemplateMessageRequest.cs index d7cd645..5fe2ced 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/TextTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/TextTemplateMessageRequest.cs @@ -50,6 +50,9 @@ public class TextMessageParameter [JsonProperty("type")] public string Type { get; set; } + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + [JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] public TemplateImage Image { get; set; } diff --git a/WhatsappBusiness.CloudApi/Messages/Requests/VideoTemplateMessageRequest.cs b/WhatsappBusiness.CloudApi/Messages/Requests/VideoTemplateMessageRequest.cs index a2ab60d..7b86a98 100644 --- a/WhatsappBusiness.CloudApi/Messages/Requests/VideoTemplateMessageRequest.cs +++ b/WhatsappBusiness.CloudApi/Messages/Requests/VideoTemplateMessageRequest.cs @@ -50,7 +50,10 @@ public class VideoMessageParameter [JsonProperty("type")] public string Type { get; set; } - [JsonProperty("video", NullValueHandling = NullValueHandling.Ignore)] + [JsonProperty("parameter_name", NullValueHandling = NullValueHandling.Ignore)] + public string ParameterName { get; set; } + + [JsonProperty("video", NullValueHandling = NullValueHandling.Ignore)] public Video Video { get; set; } [JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] diff --git a/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj b/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj index 192817d..41a0522 100644 --- a/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj +++ b/WhatsappBusiness.CloudApi/WhatsappBusiness.CloudApi.csproj @@ -12,7 +12,7 @@ https://github.com/gabrieldwight/Whatsapp-Business-Cloud-Api-Net enable latest - 1.0.40 + 1.0.41