-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for SPM Template Messages
- Loading branch information
1 parent
fa055a5
commit 3ed07cf
Showing
3 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
WhatsappBusiness.CloudApi/Messages/Requests/SingleProductTemplateMessageRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace WhatsappBusiness.CloudApi.Messages.Requests | ||
{ | ||
public class SingleProductTemplateMessageRequest | ||
{ | ||
[JsonProperty("messaging_product")] | ||
public string MessagingProduct { get; private set; } = "whatsapp"; | ||
|
||
[JsonProperty("recipient_type")] | ||
public string RecipientType { get; private set; } = "individual"; | ||
|
||
[JsonProperty("to")] | ||
public string To { get; set; } | ||
|
||
[JsonProperty("type")] | ||
public string Type { get; private set; } = "template"; | ||
|
||
[JsonProperty("template")] | ||
public SPMTemplate Template { get; set; } | ||
} | ||
|
||
public class SPMTemplate | ||
{ | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("language")] | ||
public SPMLanguage Language { get; set; } | ||
|
||
[JsonProperty("components")] | ||
public List<SPMComponent> Components { get; set; } | ||
} | ||
|
||
public class SPMComponent | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("parameters")] | ||
public List<SPMParameter> Parameters { get; set; } | ||
|
||
[JsonProperty("format", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Format { get; set; } | ||
|
||
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty("buttons", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<SPMButtons> Buttons { get; set; } | ||
} | ||
|
||
public class SPMParameter | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty("product", NullValueHandling = NullValueHandling.Ignore)] | ||
public SPMProduct Product { get; set; } | ||
} | ||
|
||
public class SPMProduct | ||
{ | ||
[JsonProperty("product_retailer_id")] | ||
public string ProductId { get; set; } | ||
|
||
[JsonProperty("catalog_id")] | ||
public string CatalogId { get; set; } | ||
} | ||
|
||
public class SPMButtons | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("text")] | ||
public string Text { get; set; } | ||
} | ||
|
||
public class SPMLanguage | ||
{ | ||
[JsonProperty("policy")] | ||
public string Policy { get; set; } | ||
|
||
[JsonProperty("code")] | ||
public string Code { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters