Skip to content

Commit 8b27160

Browse files
Bulk Regex Add of CancellationToken Parameters
1 parent 18dd755 commit 8b27160

20 files changed

+202
-186
lines changed

src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public static BrandRegistrationOtpResource Create(CreateBrandRegistrationOtpOpti
6868
/// <param name="options"> Create BrandRegistrationOtp parameters </param>
6969
/// <param name="client"> Client to make requests to Twilio </param>
7070
/// <returns> Task that resolves to A single instance of BrandRegistrationOtp </returns>
71-
public static async System.Threading.Tasks.Task<BrandRegistrationOtpResource> CreateAsync(CreateBrandRegistrationOtpOptions options, ITwilioRestClient client = null)
71+
public static async System.Threading.Tasks.Task<BrandRegistrationOtpResource> CreateAsync(CreateBrandRegistrationOtpOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7272
{
7373
client = client ?? TwilioClient.GetRestClient();
74-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
74+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7575
return FromJson(response.Content);
7676
}
7777
#endif
@@ -98,7 +98,7 @@ public static async System.Threading.Tasks.Task<BrandRegistrationOtpResource> Cr
9898
ITwilioRestClient client = null)
9999
{
100100
var options = new CreateBrandRegistrationOtpOptions(pathBrandRegistrationSid){ };
101-
return await CreateAsync(options, client);
101+
return await CreateAsync(options, client, cancellationToken);
102102
}
103103
#endif
104104

src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingResource.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public static BrandVettingResource Create(CreateBrandVettingOptions options, ITw
8080
/// <param name="options"> Create BrandVetting parameters </param>
8181
/// <param name="client"> Client to make requests to Twilio </param>
8282
/// <returns> Task that resolves to A single instance of BrandVetting </returns>
83-
public static async System.Threading.Tasks.Task<BrandVettingResource> CreateAsync(CreateBrandVettingOptions options, ITwilioRestClient client = null)
83+
public static async System.Threading.Tasks.Task<BrandVettingResource> CreateAsync(CreateBrandVettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
8484
{
8585
client = client ?? TwilioClient.GetRestClient();
86-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
86+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
8787
return FromJson(response.Content);
8888
}
8989
#endif
@@ -118,7 +118,7 @@ public static async System.Threading.Tasks.Task<BrandVettingResource> CreateAsyn
118118
ITwilioRestClient client = null)
119119
{
120120
var options = new CreateBrandVettingOptions(pathBrandSid, vettingProvider){ VettingId = vettingId };
121-
return await CreateAsync(options, client);
121+
return await CreateAsync(options, client, cancellationToken);
122122
}
123123
#endif
124124

@@ -157,10 +157,10 @@ public static BrandVettingResource Fetch(FetchBrandVettingOptions options, ITwil
157157
/// <param name="options"> Fetch BrandVetting parameters </param>
158158
/// <param name="client"> Client to make requests to Twilio </param>
159159
/// <returns> Task that resolves to A single instance of BrandVetting </returns>
160-
public static async System.Threading.Tasks.Task<BrandVettingResource> FetchAsync(FetchBrandVettingOptions options, ITwilioRestClient client = null)
160+
public static async System.Threading.Tasks.Task<BrandVettingResource> FetchAsync(FetchBrandVettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
161161
{
162162
client = client ?? TwilioClient.GetRestClient();
163-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
163+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
164164
return FromJson(response.Content);
165165
}
166166
#endif
@@ -187,7 +187,7 @@ public static BrandVettingResource Fetch(
187187
public static async System.Threading.Tasks.Task<BrandVettingResource> FetchAsync(string pathBrandSid, string pathBrandVettingSid, ITwilioRestClient client = null)
188188
{
189189
var options = new FetchBrandVettingOptions(pathBrandSid, pathBrandVettingSid){ };
190-
return await FetchAsync(options, client);
190+
return await FetchAsync(options, client, cancellationToken);
191191
}
192192
#endif
193193

@@ -224,10 +224,10 @@ public static ResourceSet<BrandVettingResource> Read(ReadBrandVettingOptions opt
224224
/// <param name="options"> Read BrandVetting parameters </param>
225225
/// <param name="client"> Client to make requests to Twilio </param>
226226
/// <returns> Task that resolves to A single instance of BrandVetting </returns>
227-
public static async System.Threading.Tasks.Task<ResourceSet<BrandVettingResource>> ReadAsync(ReadBrandVettingOptions options, ITwilioRestClient client = null)
227+
public static async System.Threading.Tasks.Task<ResourceSet<BrandVettingResource>> ReadAsync(ReadBrandVettingOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
228228
{
229229
client = client ?? TwilioClient.GetRestClient();
230-
var response = await client.RequestAsync(BuildReadRequest(options, client));
230+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
231231

232232
var page = Page<BrandVettingResource>.FromJson("data", response.Content);
233233
return new ResourceSet<BrandVettingResource>(page, options, client);
@@ -267,7 +267,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<BrandVettingResource
267267
ITwilioRestClient client = null)
268268
{
269269
var options = new ReadBrandVettingOptions(pathBrandSid){ VettingProvider = vettingProvider, PageSize = pageSize, Limit = limit};
270-
return await ReadAsync(options, client);
270+
return await ReadAsync(options, client, cancellationToken);
271271
}
272272
#endif
273273

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ public static BrandRegistrationResource Create(CreateBrandRegistrationOptions op
113113
/// <param name="options"> Create BrandRegistration parameters </param>
114114
/// <param name="client"> Client to make requests to Twilio </param>
115115
/// <returns> Task that resolves to A single instance of BrandRegistration </returns>
116-
public static async System.Threading.Tasks.Task<BrandRegistrationResource> CreateAsync(CreateBrandRegistrationOptions options, ITwilioRestClient client = null)
116+
public static async System.Threading.Tasks.Task<BrandRegistrationResource> CreateAsync(CreateBrandRegistrationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
117117
{
118118
client = client ?? TwilioClient.GetRestClient();
119-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
119+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
120120
return FromJson(response.Content);
121121
}
122122
#endif
@@ -159,7 +159,7 @@ public static async System.Threading.Tasks.Task<BrandRegistrationResource> Creat
159159
ITwilioRestClient client = null)
160160
{
161161
var options = new CreateBrandRegistrationOptions(customerProfileBundleSid, a2PProfileBundleSid){ BrandType = brandType, Mock = mock, SkipAutomaticSecVet = skipAutomaticSecVet };
162-
return await CreateAsync(options, client);
162+
return await CreateAsync(options, client, cancellationToken);
163163
}
164164
#endif
165165

@@ -196,10 +196,10 @@ public static BrandRegistrationResource Fetch(FetchBrandRegistrationOptions opti
196196
/// <param name="options"> Fetch BrandRegistration parameters </param>
197197
/// <param name="client"> Client to make requests to Twilio </param>
198198
/// <returns> Task that resolves to A single instance of BrandRegistration </returns>
199-
public static async System.Threading.Tasks.Task<BrandRegistrationResource> FetchAsync(FetchBrandRegistrationOptions options, ITwilioRestClient client = null)
199+
public static async System.Threading.Tasks.Task<BrandRegistrationResource> FetchAsync(FetchBrandRegistrationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
200200
{
201201
client = client ?? TwilioClient.GetRestClient();
202-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
202+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
203203
return FromJson(response.Content);
204204
}
205205
#endif
@@ -220,10 +220,10 @@ public static BrandRegistrationResource Fetch(
220220
/// <param name="pathSid"> The SID of the Brand Registration resource to fetch. </param>
221221
/// <param name="client"> Client to make requests to Twilio </param>
222222
/// <returns> Task that resolves to A single instance of BrandRegistration </returns>
223-
public static async System.Threading.Tasks.Task<BrandRegistrationResource> FetchAsync(string pathSid, ITwilioRestClient client = null)
223+
public static async System.Threading.Tasks.Task<BrandRegistrationResource> FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
224224
{
225225
var options = new FetchBrandRegistrationOptions(pathSid){ };
226-
return await FetchAsync(options, client);
226+
return await FetchAsync(options, client, cancellationToken);
227227
}
228228
#endif
229229

@@ -258,10 +258,10 @@ public static ResourceSet<BrandRegistrationResource> Read(ReadBrandRegistrationO
258258
/// <param name="options"> Read BrandRegistration parameters </param>
259259
/// <param name="client"> Client to make requests to Twilio </param>
260260
/// <returns> Task that resolves to A single instance of BrandRegistration </returns>
261-
public static async System.Threading.Tasks.Task<ResourceSet<BrandRegistrationResource>> ReadAsync(ReadBrandRegistrationOptions options, ITwilioRestClient client = null)
261+
public static async System.Threading.Tasks.Task<ResourceSet<BrandRegistrationResource>> ReadAsync(ReadBrandRegistrationOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
262262
{
263263
client = client ?? TwilioClient.GetRestClient();
264-
var response = await client.RequestAsync(BuildReadRequest(options, client));
264+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
265265

266266
var page = Page<BrandRegistrationResource>.FromJson("data", response.Content);
267267
return new ResourceSet<BrandRegistrationResource>(page, options, client);
@@ -293,7 +293,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<BrandRegistrationRes
293293
ITwilioRestClient client = null)
294294
{
295295
var options = new ReadBrandRegistrationOptions(){ PageSize = pageSize, Limit = limit};
296-
return await ReadAsync(options, client);
296+
return await ReadAsync(options, client, cancellationToken);
297297
}
298298
#endif
299299

@@ -380,11 +380,12 @@ public static BrandRegistrationResource Update(UpdateBrandRegistrationOptions op
380380
/// <param name="client"> Client to make requests to Twilio </param>
381381
/// <returns> Task that resolves to A single instance of BrandRegistration </returns>
382382
#if !NET35
383-
public static async System.Threading.Tasks.Task<BrandRegistrationResource> UpdateAsync(UpdateBrandRegistrationOptions options,
384-
ITwilioRestClient client = null)
383+
public static async System.Threading.Tasks.Task<BrandRegistrationResource> UpdateAsync(UpdateBrandRegistrationOptions options,
384+
ITwilioRestClient client = null,
385+
CancellationToken cancellationToken = default)
385386
{
386387
client = client ?? TwilioClient.GetRestClient();
387-
var response = await client.RequestAsync(BuildUpdateRequest(options, client));
388+
var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
388389
return FromJson(response.Content);
389390
}
390391
#endif
@@ -411,7 +412,7 @@ public static async System.Threading.Tasks.Task<BrandRegistrationResource> Updat
411412
ITwilioRestClient client = null)
412413
{
413414
var options = new UpdateBrandRegistrationOptions(pathSid){ };
414-
return await UpdateAsync(options, client);
415+
return await UpdateAsync(options, client, cancellationToken);
415416
}
416417
#endif
417418

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public static DeactivationsResource Fetch(FetchDeactivationsOptions options, ITw
6565
/// <param name="options"> Fetch Deactivations parameters </param>
6666
/// <param name="client"> Client to make requests to Twilio </param>
6767
/// <returns> Task that resolves to A single instance of Deactivations </returns>
68-
public static async System.Threading.Tasks.Task<DeactivationsResource> FetchAsync(FetchDeactivationsOptions options, ITwilioRestClient client = null)
68+
public static async System.Threading.Tasks.Task<DeactivationsResource> FetchAsync(FetchDeactivationsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
6969
{
7070
client = client ?? TwilioClient.GetRestClient();
71-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
71+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
7272
return FromJson(response.Content);
7373
}
7474
#endif
@@ -92,7 +92,7 @@ public static DeactivationsResource Fetch(
9292
public static async System.Threading.Tasks.Task<DeactivationsResource> FetchAsync(DateTime? date = null, ITwilioRestClient client = null)
9393
{
9494
var options = new FetchDeactivationsOptions(){ Date = date };
95-
return await FetchAsync(options, client);
95+
return await FetchAsync(options, client, cancellationToken);
9696
}
9797
#endif
9898

0 commit comments

Comments
 (0)