-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathInfobipWhatsAppAdapterOptions.cs
54 lines (50 loc) · 2.67 KB
/
InfobipWhatsAppAdapterOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using Bot.Builder.Community.Adapters.Infobip.Core;
using Microsoft.Extensions.Configuration;
namespace Bot.Builder.Community.Adapters.Infobip.WhatsApp
{
public class InfobipWhatsAppAdapterOptions: InfobipAdapterOptionsBase
{
/// <summary>
/// Initializes a new instance of the <see cref="InfobipWhatsAppAdapterOptions"/> class using appsettings.
/// </summary>
/// <param name="configuration">Configuration</param>
/// <remarks>
/// The configuration keys are:
/// InfobipApiKey: An Infobip API key.
/// InfobipApiBaseUrl: The Infobip base url.
/// InfobipAppSecret: A secret used to validate that incoming webhooks are originated from Infobip.
/// InfobipWhatsAppNumber: A WhatsApp assigned number.
/// InfobipWhatsAppScenarioKey: A scenario key used to send WhatsApp messages through OMNI failover API.
/// </remarks>
public InfobipWhatsAppAdapterOptions(IConfiguration configuration)
: this(configuration["InfobipApiKey"],
configuration["InfobipApiBaseUrl"],
configuration["InfobipAppSecret"],
configuration["InfobipWhatsAppNumber"],
configuration["InfobipWhatsAppScenarioKey"])
{ }
/// <summary>
/// Initializes a new instance of the <see cref="InfobipWhatsAppAdapterOptions"/> class.
/// </summary>
/// <param name="apiKey">An Infobip API key.</param>
/// <param name="apiBaseUrl">The Infobip base url.</param>
/// <param name="appSecret">A secret used to validate that incoming webhooks are originated from Infobip.</param>
/// <param name="whatsAppNumber">A WhatsApp assigned number.</param>
/// <param name="whatsAppScenarioKey">A scenario key used to send WhatsApp messages through OMNI failover API.</param>
public InfobipWhatsAppAdapterOptions(string apiKey, string apiBaseUrl, string appSecret, string whatsAppNumber, string whatsAppScenarioKey): base(apiKey, apiBaseUrl, appSecret)
{
InfobipWhatsAppNumber = whatsAppNumber;
InfobipWhatsAppScenarioKey = whatsAppScenarioKey;
}
/// <summary>
/// Gets or Sets the WhatsApp assigned number.
/// </summary>
/// <value>The WhatsApp number.</value>
public string InfobipWhatsAppNumber { get; private set; }
/// <summary>
/// Gets or Sets the scenario key of scenario which will be used for sending through OMNI failover WhatsApp messages.
/// </summary>
/// <value>The scenario key.</value>
public string InfobipWhatsAppScenarioKey { get; private set; }
}
}