Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

version bump, paging fixes, SMS list fixes, updated SMSMessage class …

…casing to match API
  • Loading branch information...
commit ce768d022dbedfbcf5aa7291e52e87dab4b7ceef 1 parent c164972
@johnsheehan johnsheehan authored
Showing with 77 additions and 69 deletions.
  1. +1 −1  Twilio.nuspec
  2. +2 −2 src/Twilio.Api.Silverlight/Applications.Async.cs
  3. +2 −2 src/Twilio.Api.Silverlight/Calls.Async.cs
  4. +4 −4 src/Twilio.Api.Silverlight/Conference.Async.cs
  5. +2 −2 src/Twilio.Api.Silverlight/IncomingPhoneNumbers.Async.cs
  6. +2 −2 src/Twilio.Api.Silverlight/Notifications.Aysnc.cs
  7. +2 −2 src/Twilio.Api.Silverlight/OutgoingCallerIds.Async.cs
  8. +2 −2 src/Twilio.Api.Silverlight/Recordings.Async.cs
  9. +12 −11 src/Twilio.Api.Silverlight/Sms.Async.cs
  10. +4 −4 src/Twilio.Api.Silverlight/Transcriptions.Async.cs
  11. +2 −2 src/Twilio.Api/Applications.cs
  12. +2 −2 src/Twilio.Api/Conference.cs
  13. +7 −0 src/Twilio.Api/Core.cs
  14. +2 −2 src/Twilio.Api/IncomingPhoneNumbers.cs
  15. +1 −1  src/Twilio.Api/Model/SmsMessage.cs
  16. +1 −1  src/Twilio.Api/Model/SmsMessageResult.cs
  17. +1 −1  src/Twilio.Api/Model/SmsShortCode.cs
  18. +1 −1  src/Twilio.Api/Model/SmsShortCodeResult.cs
  19. +2 −2 src/Twilio.Api/Notifications.cs
  20. +2 −2 src/Twilio.Api/OutgoingCallerIds.cs
  21. +2 −2 src/Twilio.Api/Recordings.cs
  22. +2 −2 src/Twilio.Api/SharedAssemblyInfo.cs
  23. +14 −14 src/Twilio.Api/Sms.cs
  24. +4 −4 src/Twilio.Api/Transcriptions.cs
  25. +1 −1  src/Twilio.WebMatrix/Twilio.cs
View
2  Twilio.nuspec
@@ -9,7 +9,7 @@
<projectUrl>http://github.com/twilio/twilio-csharp</projectUrl>
<iconUrl>http://www.twilio.com/packages/company/img/logos_downloadable_round.png</iconUrl>
<licenseUrl>https://github.com/twilio/twilio-csharp/blob/master/LICENSE.txt</licenseUrl>
- <tags>REST SMS voice telephony phone twilio twiml</tags>
+ <tags>REST SMS voice telephony phone twilio twiml ASPNETWEBPAGES</tags>
<dependencies>
<dependency id="RestSharp" />
</dependencies>
View
4 src/Twilio.Api.Silverlight/Applications.Async.cs
@@ -61,8 +61,8 @@ public void ListApplications(string friendlyName, int? pageNumber, int? count, A
request.Resource = "Accounts/{AccountSid}/Applications";
if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<ApplicationResult>(request, callback);
}
View
4 src/Twilio.Api.Silverlight/Calls.Async.cs
@@ -67,8 +67,8 @@ private void AddCallListOptions(CallListRequest options, RestRequest request)
if (options.StartTime.HasValue) request.AddParameter(startTimeParameterName, options.StartTime.Value.ToString("yyyy-MM-dd"));
if (options.EndTime.HasValue) request.AddParameter(endTimeParameterName, options.EndTime.Value.ToString("yyyy-MM-dd"));
- if (options.Count.HasValue) request.AddParameter("num", options.Count.Value);
- if (options.PageNumber.HasValue) request.AddParameter("page", options.PageNumber.Value);
+ if (options.Count.HasValue) request.AddParameter("PageSize", options.Count.Value);
+ if (options.PageNumber.HasValue) request.AddParameter("Page", options.PageNumber.Value);
if (options.ParentCallSid.HasValue()) request.AddParameter("ParentCallSid", options.ParentCallSid);
}
View
8 src/Twilio.Api.Silverlight/Conference.Async.cs
@@ -61,8 +61,8 @@ private void AddConferenceListOptions(ConferenceListRequest options, RestRequest
if (options.DateCreated.HasValue) request.AddParameter(dateCreatedParameterName, options.DateCreated.Value.ToString("yyyy-MM-dd"));
if (options.DateUpdated.HasValue) request.AddParameter(dateUpdatedParameterName, options.DateUpdated.Value.ToString("yyyy-MM-dd"));
- if (options.Count.HasValue) request.AddParameter("num", options.Count.Value);
- if (options.PageNumber.HasValue) request.AddParameter("page", options.PageNumber.Value);
+ if (options.Count.HasValue) request.AddParameter("PageSize", options.Count.Value);
+ if (options.PageNumber.HasValue) request.AddParameter("Page", options.PageNumber.Value);
}
/// <summary>
@@ -108,8 +108,8 @@ public void ListConferenceParticipants(string conferenceSid, bool? muted, int? p
request.AddParameter("ConferenceSid", conferenceSid);
if (muted.HasValue) request.AddParameter("Muted", muted.Value);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<ParticipantResult>(request, (response) => callback(response));
}
View
4 src/Twilio.Api.Silverlight/IncomingPhoneNumbers.Async.cs
@@ -65,8 +65,8 @@ public void ListIncomingPhoneNumbers(string phoneNumber, string friendlyName, in
if (phoneNumber.HasValue()) request.AddParameter("PhoneNumber", phoneNumber);
if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<IncomingPhoneNumberResult>(request, (response) => callback(response));
}
View
4 src/Twilio.Api.Silverlight/Notifications.Aysnc.cs
@@ -63,8 +63,8 @@ public void ListNotifications(int? log, DateTime? messageDate, int? pageNumber,
if (log.HasValue) request.AddParameter("Log", log);
if (messageDate.HasValue) request.AddParameter("MessageDate", messageDate.Value.ToString("yyyy-MM-dd"));
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<NotificationResult>(request, (response) => callback(response));
}
View
4 src/Twilio.Api.Silverlight/OutgoingCallerIds.Async.cs
@@ -64,8 +64,8 @@ public void ListOutgoingCallerIds(string phoneNumber, string friendlyName, int?
if (phoneNumber.HasValue()) request.AddParameter("PhoneNumber", phoneNumber);
if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<OutgoingCallerIdResult>(request, (response) => callback(response));
}
View
4 src/Twilio.Api.Silverlight/Recordings.Async.cs
@@ -47,8 +47,8 @@ public void ListRecordings(string callSid, DateTime? dateCreated, int? pageNumbe
if (callSid.HasValue()) request.AddParameter("CallSid", callSid);
if (dateCreated.HasValue) request.AddParameter("DateCreated", dateCreated.Value.ToString("yyyy-MM-dd"));
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<RecordingResult>(request, (response) => callback(response));
}
View
23 src/Twilio.Api.Silverlight/Sms.Async.cs
@@ -29,14 +29,14 @@ public partial class TwilioRestClient
/// </summary>
/// <param name="smsMessageSid">The Sid of the message to retrieve</param>
/// <param name="callback">Method to call upon successful completion</param>
- public void GetSmsMessage(string smsMessageSid, Action<SmsMessage> callback)
+ public void GetSmsMessage(string smsMessageSid, Action<SMSMessage> callback)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/SMS/Messages/{SMSMessageSid}";
request.RootElement = "SMSMessage";
request.AddUrlSegment("SMSMessageSid", smsMessageSid);
- ExecuteAsync<SmsMessage>(request, (response) => callback(response));
+ ExecuteAsync<SMSMessage>(request, (response) => callback(response));
}
/// <summary>
@@ -61,12 +61,13 @@ public void ListSmsMessages(string to, string from, DateTime? dateSent, int? pag
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/SMS/Messages";
+ request.RootElement = "SMSMessages";
if (to.HasValue()) request.AddParameter("To", to);
if (from.HasValue()) request.AddParameter("From", from);
if (dateSent.HasValue) request.AddParameter("DateSent", dateSent.Value.ToString("yyyy-MM-dd"));
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<SmsMessageResult>(request, (response) => callback(response));
}
@@ -78,7 +79,7 @@ public void ListSmsMessages(string to, string from, DateTime? dateSent, int? pag
/// <param name="to">The phone number to send the message to. If using the Sandbox, this number must be a validated outgoing caller ID</param>
/// <param name="body">The message to send. Must be 160 characters or less.</param>
/// <param name="callback">Method to call upon successful completion</param>
- public void SendSmsMessage(string from, string to, string body, Action<SmsMessage> callback)
+ public void SendSmsMessage(string from, string to, string body, Action<SMSMessage> callback)
{
SendSmsMessage(from, to, body, null, callback);
}
@@ -91,7 +92,7 @@ public void SendSmsMessage(string from, string to, string body, Action<SmsMessag
/// <param name="body">The message to send. Must be 160 characters or less.</param>
/// <param name="statusCallback">A URL that Twilio will POST to when your message is processed. Twilio will POST the SmsSid as well as SmsStatus=sent or SmsStatus=failed</param>
/// <param name="callback">Method to call upon successful completion</param>
- public void SendSmsMessage(string from, string to, string body, string statusCallback, Action<SmsMessage> callback)
+ public void SendSmsMessage(string from, string to, string body, string statusCallback, Action<SMSMessage> callback)
{
Validate.IsValidLength(body, 160);
Require.Argument("from", from);
@@ -105,7 +106,7 @@ public void SendSmsMessage(string from, string to, string body, string statusCal
request.AddParameter("Body", body);
if (statusCallback.HasValue()) request.AddParameter("StatusCallback", statusCallback);
- ExecuteAsync<SmsMessage>(request, (response) => callback(response));
+ ExecuteAsync<SMSMessage>(request, (response) => callback(response));
}
/// <summary>
@@ -114,7 +115,7 @@ public void SendSmsMessage(string from, string to, string body, string statusCal
/// </summary>
/// <param name="shortCodeSid">The Sid of the ShortCode resource to return</param>
/// <param name="callback">Method to call upon successful completion</param>
- public void GetShortCode(string shortCodeSid, Action<SmsShortCode> callback)
+ public void GetShortCode(string shortCodeSid, Action<SMSShortCode> callback)
{
Require.Argument("shortCodeSid", shortCodeSid);
@@ -122,7 +123,7 @@ public void GetShortCode(string shortCodeSid, Action<SmsShortCode> callback)
request.Resource = "Accounts/{AccountSid}/SMS/ShortCodes/{ShortCodeSid}";
request.AddParameter("ShortCodeSid", shortCodeSid);
- ExecuteAsync<SmsShortCode>(request, (response) => callback(response));
+ ExecuteAsync<SMSShortCode>(request, (response) => callback(response));
}
/// <summary>
@@ -137,7 +138,7 @@ public void GetShortCode(string shortCodeSid, Action<SmsShortCode> callback)
/// <param name="smsFallbackUrl">A URL that Twilio will request if an error occurs requesting or executing the TwiML at the SmsUrl.</param>
/// <param name="smsFallbackMethod">The HTTP method that should be used to request the SmsFallbackUrl. Either GET or POST.</param>
/// <param name="callback">Method to call upon successful completion</param>
- public void UpdateShortCode(string shortCodeSid, string friendlyName, string apiVersion, string smsUrl, string smsMethod, string smsFallbackUrl, string smsFallbackMethod, Action<SmsShortCode> callback)
+ public void UpdateShortCode(string shortCodeSid, string friendlyName, string apiVersion, string smsUrl, string smsMethod, string smsFallbackUrl, string smsFallbackMethod, Action<SMSShortCode> callback)
{
Require.Argument("shortCodeSid", shortCodeSid);
@@ -152,7 +153,7 @@ public void UpdateShortCode(string shortCodeSid, string friendlyName, string api
if (smsFallbackUrl.HasValue()) request.AddParameter("SmsFallbackUrl", smsFallbackUrl);
if (smsFallbackMethod.HasValue()) request.AddParameter("SmsFallbackMethod", smsFallbackMethod);
- ExecuteAsync<SmsShortCode>(request, (response) => callback(response));
+ ExecuteAsync<SMSShortCode>(request, (response) => callback(response));
}
/// <summary>
View
8 src/Twilio.Api.Silverlight/Transcriptions.Async.cs
@@ -42,8 +42,8 @@ public void ListTranscriptions(int? pageNumber, int? count, Action<Transcription
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/Transcriptions";
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<TranscriptionResult>(request, (response) => callback(response));
}
@@ -61,8 +61,8 @@ public void ListTranscriptions(string recordingSid, int? pageNumber, int? count,
request.Resource = "Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions";
request.AddUrlSegment("RecordingSid", recordingSid);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
ExecuteAsync<TranscriptionResult>(request, (response) => callback(response));
}
View
4 src/Twilio.Api/Applications.cs
@@ -58,8 +58,8 @@ public ApplicationResult ListApplications(string friendlyName, int? pageNumber,
request.Resource = "Accounts/{AccountSid}/Applications";
if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<ApplicationResult>(request);
}
View
4 src/Twilio.Api/Conference.cs
@@ -90,8 +90,8 @@ public ParticipantResult ListConferenceParticipants(string conferenceSid, bool?
request.AddParameter("ConferenceSid", conferenceSid);
if (muted.HasValue) request.AddParameter("Muted", muted.Value);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<ParticipantResult>(request);
}
View
7 src/Twilio.Api/Core.cs
@@ -15,6 +15,7 @@
#endregion
using RestSharp;
+using System.Reflection;
namespace Twilio
@@ -49,7 +50,13 @@ public TwilioRestClient(string accountSid, string authToken)
AccountSid = accountSid;
AuthToken = authToken;
+ // silverlight friendly way to get current version
+ var assembly = Assembly.GetExecutingAssembly();
+ AssemblyName assemblyName = new AssemblyName(assembly.FullName);
+ var version = assemblyName.Version;
+
_client = new RestClient();
+ _client.UserAgent = "twilio-csharp/" + version;
_client.Authenticator = new HttpBasicAuthenticator(AccountSid, AuthToken);
_client.BaseUrl = string.Format("{0}{1}", BaseUrl, ApiVersion);
View
4 src/Twilio.Api/IncomingPhoneNumbers.cs
@@ -61,8 +61,8 @@ public IncomingPhoneNumberResult ListIncomingPhoneNumbers(string phoneNumber, st
if (phoneNumber.HasValue()) request.AddParameter("PhoneNumber", phoneNumber);
if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<IncomingPhoneNumberResult>(request);
}
View
2  src/Twilio.Api/Model/SmsMessage.cs
@@ -21,7 +21,7 @@ namespace Twilio
/// <summary>
/// An SMSMessage instance resource represents a single Twilio SMSMessage.
/// </summary>
- public class SmsMessage : TwilioBase
+ public class SMSMessage : TwilioBase
{
/// <summary>
/// A 34 character string that uniquely identifies this resource.
View
2  src/Twilio.Api/Model/SmsMessageResult.cs
@@ -25,6 +25,6 @@ public class SmsMessageResult
/// <summary>
/// List of SMSMessage resources returned by API
/// </summary>
- public TwilioList<SmsMessage> SmsMessages { get; set; }
+ public TwilioList<SMSMessage> SMSMessages { get; set; }
}
}
View
2  src/Twilio.Api/Model/SmsShortCode.cs
@@ -8,7 +8,7 @@ namespace Twilio
/// <summary>
/// Represents a single ShortCode Instance resource
/// </summary>
- public class SmsShortCode : TwilioBase
+ public class SMSShortCode : TwilioBase
{
/// <summary>
/// A 34 character string that uniquely idetifies this resource.
View
2  src/Twilio.Api/Model/SmsShortCodeResult.cs
@@ -25,6 +25,6 @@ public class SmsShortCodeResult
/// <summary>
/// List of ShortCode resources returned by API
/// </summary>
- public TwilioList<SmsShortCode> ShortCodes { get; set; }
+ public TwilioList<SMSShortCode> ShortCodes { get; set; }
}
}
View
4 src/Twilio.Api/Notifications.cs
@@ -64,8 +64,8 @@ public NotificationResult ListNotifications(int? log, DateTime? messageDate, int
if (log.HasValue) request.AddParameter("Log", log);
if (messageDate.HasValue) request.AddParameter("MessageDate", messageDate.Value.ToString("yyyy-MM-dd"));
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<NotificationResult>(request);
}
View
4 src/Twilio.Api/OutgoingCallerIds.cs
@@ -64,8 +64,8 @@ public OutgoingCallerIdResult ListOutgoingCallerIds(string phoneNumber, string f
if (phoneNumber.HasValue()) request.AddParameter("PhoneNumber", phoneNumber);
if (friendlyName.HasValue()) request.AddParameter("FriendlyName", friendlyName);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<OutgoingCallerIdResult>(request);
}
View
4 src/Twilio.Api/Recordings.cs
@@ -49,8 +49,8 @@ public RecordingResult ListRecordings(string callSid, DateTime? dateCreated, int
if (callSid.HasValue()) request.AddParameter("CallSid", callSid);
if (dateCreated.HasValue) request.AddParameter("DateCreated", dateCreated.Value.ToString("yyyy-MM-dd"));
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<RecordingResult>(request);
}
View
4 src/Twilio.Api/SharedAssemblyInfo.cs
@@ -10,5 +10,5 @@
[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("3.0.0.0")]
-[assembly: AssemblyFileVersion("3.0.0.0")]
+[assembly: AssemblyVersion("3.0.1.0")]
+[assembly: AssemblyFileVersion("3.0.1.0")]
View
28 src/Twilio.Api/Sms.cs
@@ -29,14 +29,14 @@ public partial class TwilioRestClient
/// Makes a GET request to an SMSMessage Instance resource.
/// </summary>
/// <param name="smsMessageSid">The Sid of the message to retrieve</param>
- public SmsMessage GetSmsMessage(string smsMessageSid)
+ public SMSMessage GetSmsMessage(string smsMessageSid)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/SMS/Messages/{SMSMessageSid}";
request.RootElement = "SMSMessage";
request.AddUrlSegment("SMSMessageSid", smsMessageSid);
- return Execute<SmsMessage>(request);
+ return Execute<SMSMessage>(request);
}
/// <summary>
@@ -44,9 +44,9 @@ public SmsMessage GetSmsMessage(string smsMessageSid)
/// The list includes paging information and is sorted by DateSent, with most recent messages first.
/// Makes a GET request to the SMSMessage List resource.
/// </summary>
- public SmsMessageResult GetSmsMessages()
+ public SmsMessageResult ListSmsMessages()
{
- return GetSmsMessages(null, null, null, null, null);
+ return ListSmsMessages(null, null, null, null, null);
}
/// <summary>
@@ -58,7 +58,7 @@ public SmsMessageResult GetSmsMessages()
/// <param name="dateSent">(Optional) The date the message was sent (GMT)</param>
/// <param name="pageNumber">(Optional) The page to start retrieving results from</param>
/// <param name="count">(Optional) The number of results to retrieve</param>
- public SmsMessageResult GetSmsMessages(string to, string from, DateTime? dateSent, int? pageNumber, int? count)
+ public SmsMessageResult ListSmsMessages(string to, string from, DateTime? dateSent, int? pageNumber, int? count)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/SMS/Messages";
@@ -67,8 +67,8 @@ public SmsMessageResult GetSmsMessages(string to, string from, DateTime? dateSen
if (to.HasValue()) request.AddParameter("To", to);
if (from.HasValue()) request.AddParameter("From", from);
if (dateSent.HasValue) request.AddParameter("DateSent", dateSent.Value.ToString("yyyy-MM-dd"));
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("pagesize", count.Value);
return Execute<SmsMessageResult>(request);
}
@@ -80,7 +80,7 @@ public SmsMessageResult GetSmsMessages(string to, string from, DateTime? dateSen
/// <param name="from">The phone number to send the message from. Must be a Twilio-provided or ported local (not toll-free) number. Validated outgoing caller IDs cannot be used.</param>
/// <param name="to">The phone number to send the message to. If using the Sandbox, this number must be a validated outgoing caller ID</param>
/// <param name="body">The message to send. Must be 160 characters or less.</param>
- public SmsMessage SendSmsMessage(string from, string to, string body)
+ public SMSMessage SendSmsMessage(string from, string to, string body)
{
return SendSmsMessage(from, to, body, string.Empty);
}
@@ -93,7 +93,7 @@ public SmsMessage SendSmsMessage(string from, string to, string body)
/// <param name="to">The phone number to send the message to. If using the Sandbox, this number must be a validated outgoing caller ID</param>
/// <param name="body">The message to send. Must be 160 characters or less.</param>
/// <param name="statusCallback">A URL that Twilio will POST to when your message is processed. Twilio will POST the SmsSid as well as SmsStatus=sent or SmsStatus=failed</param>
- public SmsMessage SendSmsMessage(string from, string to, string body, string statusCallback)
+ public SMSMessage SendSmsMessage(string from, string to, string body, string statusCallback)
{
Validate.IsValidLength(body, 160);
Require.Argument("from", from);
@@ -107,7 +107,7 @@ public SmsMessage SendSmsMessage(string from, string to, string body, string sta
request.AddParameter("Body", body);
if (statusCallback.HasValue()) request.AddParameter("StatusCallback", statusCallback);
- return Execute<SmsMessage>(request);
+ return Execute<SMSMessage>(request);
}
/// <summary>
@@ -115,7 +115,7 @@ public SmsMessage SendSmsMessage(string from, string to, string body, string sta
/// Makes a GET request to a ShortCode Instance resource.
/// </summary>
/// <param name="shortCodeSid">The Sid of the ShortCode resource to return</param>
- public SmsShortCode GetShortCode(string shortCodeSid)
+ public SMSShortCode GetShortCode(string shortCodeSid)
{
Require.Argument("shortCodeSid", shortCodeSid);
@@ -123,7 +123,7 @@ public SmsShortCode GetShortCode(string shortCodeSid)
request.Resource = "Accounts/{AccountSid}/SMS/ShortCodes/{ShortCodeSid}";
request.AddParameter("ShortCodeSid", shortCodeSid);
- return Execute<SmsShortCode>(request);
+ return Execute<SMSShortCode>(request);
}
/// <summary>
@@ -137,7 +137,7 @@ public SmsShortCode GetShortCode(string shortCodeSid)
/// <param name="smsMethod">The HTTP method that should be used to request the SmsUrl. Either GET or POST.</param>
/// <param name="smsFallbackUrl">A URL that Twilio will request if an error occurs requesting or executing the TwiML at the SmsUrl.</param>
/// <param name="smsFallbackMethod">The HTTP method that should be used to request the SmsFallbackUrl. Either GET or POST.</param>
- public SmsShortCode UpdateShortCode(string shortCodeSid, string friendlyName, string apiVersion, string smsUrl, string smsMethod, string smsFallbackUrl, string smsFallbackMethod)
+ public SMSShortCode UpdateShortCode(string shortCodeSid, string friendlyName, string apiVersion, string smsUrl, string smsMethod, string smsFallbackUrl, string smsFallbackMethod)
{
Require.Argument("shortCodeSid", shortCodeSid);
@@ -152,7 +152,7 @@ public SmsShortCode UpdateShortCode(string shortCodeSid, string friendlyName, st
if (smsFallbackUrl.HasValue()) request.AddParameter("SmsFallbackUrl", smsFallbackUrl);
if (smsFallbackMethod.HasValue()) request.AddParameter("SmsFallbackMethod", smsFallbackMethod);
- return Execute<SmsShortCode>(request);
+ return Execute<SMSShortCode>(request);
}
/// <summary>
View
8 src/Twilio.Api/Transcriptions.cs
@@ -42,8 +42,8 @@ public TranscriptionResult ListTranscriptions(int? pageNumber, int? count)
{
var request = new RestRequest();
request.Resource = "Accounts/{AccountSid}/Transcriptions";
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<TranscriptionResult>(request);
}
@@ -61,8 +61,8 @@ public TranscriptionResult ListTranscriptions(string recordingSid, int? pageNumb
request.Resource = "Accounts/{AccountSid}/Recordings/{RecordingSid}/Transcriptions";
request.AddUrlSegment("RecordingSid", recordingSid);
- if (pageNumber.HasValue) request.AddParameter("page", pageNumber.Value);
- if (count.HasValue) request.AddParameter("num", count.Value);
+ if (pageNumber.HasValue) request.AddParameter("Page", pageNumber.Value);
+ if (count.HasValue) request.AddParameter("PageSize", count.Value);
return Execute<TranscriptionResult>(request);
}
View
2  src/Twilio.WebMatrix/Twilio.cs
@@ -26,7 +26,7 @@ public class Twilio
/// <param name="body">The contents of the message, up to 160 characters</param>
/// <param name="statusCallbackUrl">The URL to notify of the message status</param>
/// <returns>An SMSMessage Instance resource</returns>
- public static SmsMessage SendSms(string from, string to, string body, string statusCallbackUrl)
+ public static SMSMessage SendSms(string from, string to, string body, string statusCallbackUrl)
{
CheckForCredentials();
Please sign in to comment.
Something went wrong with that request. Please try again.