-
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.
- Loading branch information
1 parent
e6229dd
commit 090b040
Showing
4 changed files
with
309 additions
and
0 deletions.
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
WhatsappBusiness.CloudApi/Messages/Requests/CarouselTemplateMessageRequest.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,107 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace WhatsappBusiness.CloudApi.Messages.Requests | ||
{ | ||
public class CarouselTemplateMessageRequest | ||
{ | ||
[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 CarouselMessageTemplate Template { get; set; } | ||
} | ||
|
||
public class CarouselMessageTemplate | ||
{ | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("language")] | ||
public CarouselMessageLanguage Language { get; set; } | ||
|
||
[JsonProperty("components")] | ||
public List<CarouselMessageTemplateComponent> Components { get; set; } | ||
} | ||
|
||
public class CarouselMessageTemplateComponent | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("parameters", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<CarouselMessageParameter> Parameters { get; set; } | ||
|
||
[JsonProperty("cards", NullValueHandling = NullValueHandling.Ignore)] | ||
public List<CarouselMessageCard> Cards { get; set; } | ||
} | ||
|
||
public class CarouselMessageCard | ||
{ | ||
[JsonProperty("card_index")] | ||
public int CardIndex { get; set; } | ||
|
||
[JsonProperty("components")] | ||
public List<CarouselCardComponent> Components { get; set; } | ||
} | ||
|
||
public class CarouselCardComponent | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("parameters")] | ||
public List<CardMessageParameter> 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 CardMessageParameter | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("image", NullValueHandling = NullValueHandling.Ignore)] | ||
public CardImage Image { get; set; } | ||
|
||
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty("payload", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Payload { get; set; } | ||
} | ||
|
||
public class CardImage | ||
{ | ||
[JsonProperty("id")] | ||
public string Id { get; set; } | ||
} | ||
|
||
public partial class CarouselMessageParameter | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("text")] | ||
public string Text { get; set; } | ||
} | ||
|
||
public class CarouselMessageLanguage | ||
{ | ||
[JsonProperty("code")] | ||
public string Code { get; set; } | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
WhatsappBusiness.CloudApi/Messages/Requests/CatalogMessageRequest.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,63 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace WhatsappBusiness.CloudApi.Messages.Requests | ||
{ | ||
public class CatalogMessageRequest | ||
{ | ||
[JsonProperty("messaging_product")] | ||
public string MessagingProduct { get; set; } | ||
|
||
[JsonProperty("recipient_type")] | ||
public string RecipientType { get; set; } | ||
|
||
[JsonProperty("to")] | ||
public string To { get; set; } | ||
|
||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("interactive")] | ||
public CatalogMessageInteractive Interactive { get; set; } | ||
} | ||
|
||
public class CatalogMessageInteractive | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("body")] | ||
public CatalogMessageBody Body { get; set; } | ||
|
||
[JsonProperty("action")] | ||
public CatalogMessageAction Action { get; set; } | ||
|
||
[JsonProperty("footer")] | ||
public CatalogMessageFooter Footer { get; set; } | ||
} | ||
|
||
public class CatalogMessageAction | ||
{ | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("parameters")] | ||
public CatalogMessageParameters Parameters { get; set; } | ||
} | ||
|
||
public class CatalogMessageParameters | ||
{ | ||
[JsonProperty("thumbnail_product_retailer_id")] | ||
public string ThumbnailProductRetailerId { get; set; } | ||
} | ||
|
||
public class CatalogMessageBody | ||
{ | ||
[JsonProperty("text")] | ||
public string Text { get; set; } | ||
} | ||
|
||
public class CatalogMessageFooter : CatalogMessageBody | ||
{ | ||
|
||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
WhatsappBusiness.CloudApi/Messages/Requests/CatalogTemplateMessageRequest.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,74 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace WhatsappBusiness.CloudApi.Messages.Requests | ||
{ | ||
public class CatalogTemplateMessageRequest | ||
{ | ||
[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 CatalogMessageTemplate Template { get; set; } | ||
} | ||
|
||
public class CatalogMessageTemplate | ||
{ | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("language")] | ||
public CatalogMessageLanguage Language { get; set; } | ||
|
||
[JsonProperty("components")] | ||
public List<CatalogMessageComponent> Components { get; set; } | ||
} | ||
|
||
public class CatalogMessageComponent | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("parameters")] | ||
public List<CatalogTemplateMessageParameter> 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 CatalogTemplateMessageParameter | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty("action", NullValueHandling = NullValueHandling.Ignore)] | ||
public CatalogTemplateMessageAction Action { get; set; } | ||
} | ||
|
||
public class CatalogTemplateMessageAction | ||
{ | ||
[JsonProperty("thumbnail_product_retailer_id")] | ||
public string ThumbnailProductRetailerId { get; set; } | ||
} | ||
|
||
public class CatalogMessageLanguage | ||
{ | ||
[JsonProperty("code")] | ||
public string Code { get; set; } | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
WhatsappBusiness.CloudApi/Messages/Requests/CouponCodeTemplateMessageRequest.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,65 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace WhatsappBusiness.CloudApi.Messages.Requests | ||
{ | ||
public class CouponCodeTemplateMessageRequest | ||
{ | ||
[JsonProperty("messaging_product")] | ||
public string MessagingProduct { get; private set; } = "whatsapp"; | ||
|
||
[JsonProperty("to")] | ||
public string To { get; set; } | ||
|
||
[JsonProperty("type")] | ||
public string Type { get; private set; } = "template"; | ||
|
||
[JsonProperty("template")] | ||
public CouponCodeMessageTemplate Template { get; set; } | ||
} | ||
|
||
public class CouponCodeMessageTemplate | ||
{ | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonProperty("language")] | ||
public CouponCodeMessageLanguage Language { get; set; } | ||
|
||
[JsonProperty("components")] | ||
public List<CouponCodeMessageComponent> Components { get; set; } | ||
} | ||
|
||
public class CouponCodeMessageComponent | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("parameters")] | ||
public List<CouponCodeMessageParameter> Parameters { get; set; } | ||
|
||
[JsonProperty("sub_type", NullValueHandling = NullValueHandling.Ignore)] | ||
public string SubType { get; set; } | ||
|
||
[JsonProperty("index", NullValueHandling = NullValueHandling.Ignore)] | ||
public int? Index { get; set; } | ||
} | ||
|
||
public class CouponCodeMessageParameter | ||
{ | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("text", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty("coupon_code", NullValueHandling = NullValueHandling.Ignore)] | ||
public string CouponCode { get; set; } | ||
} | ||
|
||
public class CouponCodeMessageLanguage | ||
{ | ||
[JsonProperty("code")] | ||
public string Code { get; set; } | ||
} | ||
} |