Skip to content

Commit 442e3bd

Browse files
committed
Release 5.3.1-alpha1
1 parent d37e885 commit 442e3bd

File tree

10 files changed

+187
-14
lines changed

10 files changed

+187
-14
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
twilio-csharp Changelog
22
=======================
33

4+
[2017-04-17] Version 5.3.1-alpha1
5+
--------------------------
6+
- Allow moving Phone Numbers to subaccounts
7+
- Add `SmartEncoding` to Messaging Services
8+
- Allow deleting of Wireless `RatePlans`
9+
410
[2017-04-13] Version 5.2.2-alpha1
511
--------------------------
612
- Add `validityPeriod` to Message creation

src/Twilio/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
internal class AssemblyInfomation
1616
{
17-
public const string AssemblyInformationalVersion = "5.2.2-alpha1";
17+
public const string AssemblyInformationalVersion = "5.3.1-alpha1";
1818
}

src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ public UpdateIncomingPhoneNumberOptions(string pathSid)
111111
public List<KeyValuePair<string, string>> GetParams()
112112
{
113113
var p = new List<KeyValuePair<string, string>>();
114+
if (AccountSid != null)
115+
{
116+
p.Add(new KeyValuePair<string, string>("AccountSid", AccountSid.ToString()));
117+
}
118+
114119
if (ApiVersion != null)
115120
{
116121
p.Add(new KeyValuePair<string, string>("ApiVersion", ApiVersion));

src/Twilio/Rest/Messaging/V1/ServiceOptions.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public class CreateServiceOptions : IOptions<ServiceResource>
4242
/// The mms_converter
4343
/// </summary>
4444
public bool? MmsConverter { get; set; }
45+
/// <summary>
46+
/// The smart_encoding
47+
/// </summary>
48+
public bool? SmartEncoding { get; set; }
4549

4650
/// <summary>
4751
/// Construct a new CreateServiceOptions
@@ -99,6 +103,11 @@ public List<KeyValuePair<string, string>> GetParams()
99103
p.Add(new KeyValuePair<string, string>("MmsConverter", MmsConverter.Value.ToString()));
100104
}
101105

106+
if (SmartEncoding != null)
107+
{
108+
p.Add(new KeyValuePair<string, string>("SmartEncoding", SmartEncoding.Value.ToString()));
109+
}
110+
102111
return p;
103112
}
104113
}
@@ -144,6 +153,10 @@ public class UpdateServiceOptions : IOptions<ServiceResource>
144153
/// The mms_converter
145154
/// </summary>
146155
public bool? MmsConverter { get; set; }
156+
/// <summary>
157+
/// The smart_encoding
158+
/// </summary>
159+
public bool? SmartEncoding { get; set; }
147160

148161
/// <summary>
149162
/// Construct a new UpdateServiceOptions
@@ -201,6 +214,11 @@ public List<KeyValuePair<string, string>> GetParams()
201214
p.Add(new KeyValuePair<string, string>("MmsConverter", MmsConverter.Value.ToString()));
202215
}
203216

217+
if (SmartEncoding != null)
218+
{
219+
p.Add(new KeyValuePair<string, string>("SmartEncoding", SmartEncoding.Value.ToString()));
220+
}
221+
204222
return p;
205223
}
206224
}

src/Twilio/Rest/Messaging/V1/ServiceResource.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ public static async System.Threading.Tasks.Task<ServiceResource> CreateAsync(Cre
6868
/// <param name="statusCallback"> The status_callback </param>
6969
/// <param name="stickySender"> The sticky_sender </param>
7070
/// <param name="mmsConverter"> The mms_converter </param>
71+
/// <param name="smartEncoding"> The smart_encoding </param>
7172
/// <param name="client"> Client to make requests to Twilio </param>
7273
/// <returns> A single instance of Service </returns>
73-
public static ServiceResource Create(string friendlyName, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, ITwilioRestClient client = null)
74+
public static ServiceResource Create(string friendlyName, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, bool? smartEncoding = null, ITwilioRestClient client = null)
7475
{
75-
var options = new CreateServiceOptions(friendlyName){InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter};
76+
var options = new CreateServiceOptions(friendlyName){InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding};
7677
return Create(options, client);
7778
}
7879

@@ -89,11 +90,12 @@ public static ServiceResource Create(string friendlyName, Uri inboundRequestUrl
8990
/// <param name="statusCallback"> The status_callback </param>
9091
/// <param name="stickySender"> The sticky_sender </param>
9192
/// <param name="mmsConverter"> The mms_converter </param>
93+
/// <param name="smartEncoding"> The smart_encoding </param>
9294
/// <param name="client"> Client to make requests to Twilio </param>
9395
/// <returns> Task that resolves to A single instance of Service </returns>
94-
public static async System.Threading.Tasks.Task<ServiceResource> CreateAsync(string friendlyName, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, ITwilioRestClient client = null)
96+
public static async System.Threading.Tasks.Task<ServiceResource> CreateAsync(string friendlyName, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, bool? smartEncoding = null, ITwilioRestClient client = null)
9597
{
96-
var options = new CreateServiceOptions(friendlyName){InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter};
98+
var options = new CreateServiceOptions(friendlyName){InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding};
9799
return await CreateAsync(options, client);
98100
}
99101
#endif
@@ -152,11 +154,12 @@ public static async System.Threading.Tasks.Task<ServiceResource> UpdateAsync(Upd
152154
/// <param name="statusCallback"> The status_callback </param>
153155
/// <param name="stickySender"> The sticky_sender </param>
154156
/// <param name="mmsConverter"> The mms_converter </param>
157+
/// <param name="smartEncoding"> The smart_encoding </param>
155158
/// <param name="client"> Client to make requests to Twilio </param>
156159
/// <returns> A single instance of Service </returns>
157-
public static ServiceResource Update(string pathSid, string friendlyName = null, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, ITwilioRestClient client = null)
160+
public static ServiceResource Update(string pathSid, string friendlyName = null, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, bool? smartEncoding = null, ITwilioRestClient client = null)
158161
{
159-
var options = new UpdateServiceOptions(pathSid){FriendlyName = friendlyName, InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter};
162+
var options = new UpdateServiceOptions(pathSid){FriendlyName = friendlyName, InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding};
160163
return Update(options, client);
161164
}
162165

@@ -174,11 +177,12 @@ public static ServiceResource Update(string pathSid, string friendlyName = null,
174177
/// <param name="statusCallback"> The status_callback </param>
175178
/// <param name="stickySender"> The sticky_sender </param>
176179
/// <param name="mmsConverter"> The mms_converter </param>
180+
/// <param name="smartEncoding"> The smart_encoding </param>
177181
/// <param name="client"> Client to make requests to Twilio </param>
178182
/// <returns> Task that resolves to A single instance of Service </returns>
179-
public static async System.Threading.Tasks.Task<ServiceResource> UpdateAsync(string pathSid, string friendlyName = null, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, ITwilioRestClient client = null)
183+
public static async System.Threading.Tasks.Task<ServiceResource> UpdateAsync(string pathSid, string friendlyName = null, Uri inboundRequestUrl = null, Twilio.Http.HttpMethod inboundMethod = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, bool? stickySender = null, bool? mmsConverter = null, bool? smartEncoding = null, ITwilioRestClient client = null)
180184
{
181-
var options = new UpdateServiceOptions(pathSid){FriendlyName = friendlyName, InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter};
185+
var options = new UpdateServiceOptions(pathSid){FriendlyName = friendlyName, InboundRequestUrl = inboundRequestUrl, InboundMethod = inboundMethod, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StickySender = stickySender, MmsConverter = mmsConverter, SmartEncoding = smartEncoding};
182186
return await UpdateAsync(options, client);
183187
}
184188
#endif
@@ -499,6 +503,11 @@ public static ServiceResource FromJson(string json)
499503
[JsonProperty("mms_converter")]
500504
public bool? MmsConverter { get; private set; }
501505
/// <summary>
506+
/// The smart_encoding
507+
/// </summary>
508+
[JsonProperty("smart_encoding")]
509+
public bool? SmartEncoding { get; private set; }
510+
/// <summary>
502511
/// The url
503512
/// </summary>
504513
[JsonProperty("url")]

src/Twilio/Rest/Preview/Wireless/RatePlanOptions.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,34 @@ public List<KeyValuePair<string, string>> GetParams()
191191
}
192192
}
193193

194+
/// <summary>
195+
/// DeleteRatePlanOptions
196+
/// </summary>
197+
public class DeleteRatePlanOptions : IOptions<RatePlanResource>
198+
{
199+
/// <summary>
200+
/// The sid
201+
/// </summary>
202+
public string PathSid { get; }
203+
204+
/// <summary>
205+
/// Construct a new DeleteRatePlanOptions
206+
/// </summary>
207+
///
208+
/// <param name="pathSid"> The sid </param>
209+
public DeleteRatePlanOptions(string pathSid)
210+
{
211+
PathSid = pathSid;
212+
}
213+
214+
/// <summary>
215+
/// Generate the necessary parameters
216+
/// </summary>
217+
public List<KeyValuePair<string, string>> GetParams()
218+
{
219+
var p = new List<KeyValuePair<string, string>>();
220+
return p;
221+
}
222+
}
223+
194224
}

src/Twilio/Rest/Preview/Wireless/RatePlanResource.cs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,75 @@ public static async System.Threading.Tasks.Task<RatePlanResource> UpdateAsync(st
334334
}
335335
#endif
336336

337+
private static Request BuildDeleteRequest(DeleteRatePlanOptions options, ITwilioRestClient client)
338+
{
339+
return new Request(
340+
HttpMethod.Delete,
341+
Rest.Domain.Preview,
342+
"/wireless/RatePlans/" + options.PathSid + "",
343+
client.Region,
344+
queryParams: options.GetParams()
345+
);
346+
}
347+
348+
/// <summary>
349+
/// delete
350+
/// </summary>
351+
///
352+
/// <param name="options"> Delete RatePlan parameters </param>
353+
/// <param name="client"> Client to make requests to Twilio </param>
354+
/// <returns> A single instance of RatePlan </returns>
355+
public static bool Delete(DeleteRatePlanOptions options, ITwilioRestClient client = null)
356+
{
357+
client = client ?? TwilioClient.GetRestClient();
358+
var response = client.Request(BuildDeleteRequest(options, client));
359+
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
360+
}
361+
362+
#if !NET35
363+
/// <summary>
364+
/// delete
365+
/// </summary>
366+
///
367+
/// <param name="options"> Delete RatePlan parameters </param>
368+
/// <param name="client"> Client to make requests to Twilio </param>
369+
/// <returns> Task that resolves to A single instance of RatePlan </returns>
370+
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteRatePlanOptions options, ITwilioRestClient client = null)
371+
{
372+
client = client ?? TwilioClient.GetRestClient();
373+
var response = await client.RequestAsync(BuildDeleteRequest(options, client));
374+
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
375+
}
376+
#endif
377+
378+
/// <summary>
379+
/// delete
380+
/// </summary>
381+
///
382+
/// <param name="pathSid"> The sid </param>
383+
/// <param name="client"> Client to make requests to Twilio </param>
384+
/// <returns> A single instance of RatePlan </returns>
385+
public static bool Delete(string pathSid, ITwilioRestClient client = null)
386+
{
387+
var options = new DeleteRatePlanOptions(pathSid);
388+
return Delete(options, client);
389+
}
390+
391+
#if !NET35
392+
/// <summary>
393+
/// delete
394+
/// </summary>
395+
///
396+
/// <param name="pathSid"> The sid </param>
397+
/// <param name="client"> Client to make requests to Twilio </param>
398+
/// <returns> Task that resolves to A single instance of RatePlan </returns>
399+
public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathSid, ITwilioRestClient client = null)
400+
{
401+
var options = new DeleteRatePlanOptions(pathSid);
402+
return await DeleteAsync(options, client);
403+
}
404+
#endif
405+
337406
/// <summary>
338407
/// Converts a JSON string into a RatePlanResource object
339408
/// </summary>

src/Twilio/Twilio.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Copyright>Copyright © Twilio</Copyright>
88
<AssemblyTitle>Twilio</AssemblyTitle>
99
<NeutralLanguage>en-US</NeutralLanguage>
10-
<Version>5.2.2-alpha1</Version>
10+
<Version>5.3.1-alpha1</Version>
1111
<Authors>Twilio</Authors>
1212
<NoWarn>$(NoWarn);CS1591</NoWarn>
1313
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

0 commit comments

Comments
 (0)