generated from Kentico/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITwilioSmsClient.cs
33 lines (29 loc) · 1.49 KB
/
ITwilioSmsClient.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
using System.Threading.Tasks;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Rest.Lookups.V2;
namespace Kentico.Xperience.Twilio.SMS.Services
{
/// <summary>
/// Contains methods for interfacing with the Twilio SMS API.
/// </summary>
public interface ITwilioSmsClient
{
/// <summary>
/// Sends an SMS message using the provided <paramref name="options"/>.
/// </summary>
/// <remarks>If no <see cref="CreateMessageOptions.From"/> or <see cref="CreateMessageOptions.MessagingServiceSid"/> is set,
/// the default Messaging Service from the Xperience settings will be used.</remarks>
/// <param name="options">The options to use.</param>
/// <returns>The response from the Twilio API.</returns>
Task<MessageResource> SendMessageAsync(CreateMessageOptions options);
/// <summary>
/// Validates the provided <paramref name="phoneNumber"/> with Twilio's API to convert a potentially invalid number into
/// one that is accepted by Twilio's services.
/// </summary>
/// <param name="phoneNumber">The number to validate.</param>
/// <param name="countryCode">Country code for national phone number lookups. If not provided, the number is verified with
/// Twilio's international lookup service.</param>
/// <returns>The response from the Twilio API.</returns>
Task<PhoneNumberResource> ValidatePhoneNumberAsync(string phoneNumber, string countryCode = null);
}
}