-
Notifications
You must be signed in to change notification settings - Fork 131
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 LTO Template message
- Loading branch information
1 parent
090b040
commit 272a7e7
Showing
5 changed files
with
222 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
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
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
86 changes: 86 additions & 0 deletions
86
WhatsappBusiness.CloudApi/Messages/Requests/LimitedTimeOfferTemplateMessageRequest.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,86 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace WhatsappBusiness.CloudApi.Messages.Requests | ||
{ | ||
public class LimitedTimeOfferTemplateMessageRequest | ||
{ | ||
[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 LimitedTimeOfferMessageTemplate Template { get; set; } | ||
} | ||
|
||
public class LimitedTimeOfferMessageTemplate | ||
{ | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("language")] | ||
public LimitedTimeOfferMessageLanguage Language { get; set; } | ||
|
||
[JsonProperty("components")] | ||
public List<LimitedTimeOfferMessageComponent> Components { get; set; } | ||
} | ||
|
||
public class LimitedTimeOfferMessageComponent | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("parameters")] | ||
public List<LimitedTimeOfferMessageParameter> Parameters { get; set; } | ||
|
||
[JsonProperty("sub_type", NullValueHandling = NullValueHandling.Ignore)] | ||
public string SubType { get; set; } | ||
|
||
[JsonProperty("index", NullValueHandling = NullValueHandling.Ignore)] | ||
public long? Index { get; set; } | ||
} | ||
|
||
public class LimitedTimeOfferMessageParameter | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] | ||
public LimitedTimeOfferMessageImage Image { get; set; } | ||
|
||
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty("limited_time_offer", NullValueHandling = NullValueHandling.Ignore)] | ||
public LimitedTimeOffer LimitedTimeOffer { get; set; } | ||
|
||
[JsonProperty("coupon_code", NullValueHandling = NullValueHandling.Ignore)] | ||
public string CouponCode { get; set; } | ||
} | ||
|
||
public class LimitedTimeOfferMessageImage | ||
{ | ||
[JsonProperty("id")] | ||
public string Id { get; set; } | ||
} | ||
|
||
public class LimitedTimeOffer | ||
{ | ||
[JsonProperty("expiration_time_ms")] | ||
public long ExpirationTimeMs { get; set; } | ||
} | ||
|
||
public class LimitedTimeOfferMessageLanguage | ||
{ | ||
[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