-
Notifications
You must be signed in to change notification settings - Fork 175
Expand file tree
/
Copy pathTwilioClientWrapperOptions.cs
More file actions
76 lines (67 loc) · 3.22 KB
/
TwilioClientWrapperOptions.cs
File metadata and controls
76 lines (67 loc) · 3.22 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
namespace Bot.Builder.Community.Adapters.Twilio
{
/// <summary>
/// Defines options for a <see cref="TwilioClientWrapper"/>.
/// </summary>
public class TwilioClientWrapperOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="TwilioClientWrapperOptions"/> class.
/// </summary>
/// <param name="twilioNumber">The twilio phone number.</param>
/// <param name="twilioAccountSid">The account id.</param>
/// <param name="twilioAuthToken">The authentication token.</param>
/// <param name="twilioValidationUrl">The validation URL for incoming requests.</param>
public TwilioClientWrapperOptions(string twilioNumber, string twilioAccountSid, string twilioAuthToken, Uri twilioValidationUrl = null)
{
if (string.IsNullOrWhiteSpace(twilioNumber))
{
throw new ArgumentException($"The {nameof(twilioNumber)} property for {nameof(TwilioAdapterOptions)} can't be empty.", nameof(twilioNumber));
}
if (string.IsNullOrWhiteSpace(twilioAccountSid))
{
throw new ArgumentException($"The {nameof(twilioNumber)} property for {nameof(TwilioAdapterOptions)} can't be empty.", nameof(twilioAccountSid));
}
if (string.IsNullOrWhiteSpace(twilioAuthToken))
{
throw new ArgumentException($"The {nameof(twilioAuthToken)} property for {nameof(TwilioAdapterOptions)} can't be empty.", nameof(twilioAuthToken));
}
TwilioNumber = twilioNumber;
TwilioAccountSid = twilioAccountSid;
TwilioAuthToken = twilioAuthToken;
TwilioValidationUrl = twilioValidationUrl;
}
/// <summary>
/// Gets or sets the phone number associated with this Twilio app.
/// </summary>
/// <value>
/// The phone number.
/// </value>
public string TwilioNumber { get; set; }
/// <summary>
/// Gets or sets the account SID from the Twilio account.
/// </summary>
/// <value>The account SID.</value>
public string TwilioAccountSid { get; set; }
/// <summary>
/// Gets or sets the API auth token associated with the Twilio account.
/// </summary>
/// <value>The authentication token.</value>
public string TwilioAuthToken { get; set; }
/// <summary>
/// Gets or sets an optional validation URL.
/// </summary>
/// <value>Optional validation URL to override the automatically generated URL signature used
/// to validate incoming requests. See the Twilio security documentation on
/// [validating requests](https://www.twilio.com/docs/usage/security#validating-requests).</value>
public Uri TwilioValidationUrl { get; set; }
/// <summary>
/// Gets or sets a value indicating whether incoming requests are validated as being genuine requests from Twilio.
/// </summary>
/// <value>
/// A flag indicating whether incoming requests are validated as being genuine requests from Twilio.
/// </value>
public bool ValidateIncomingRequests { get; set; } = true;
}
}