Skip to content

Commit 982b2e1

Browse files
committed
Bulk Regex Add of CancellationToken Parameters
1 parent e35a0c0 commit 982b2e1

File tree

473 files changed

+5152
-4730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+5152
-4730
lines changed

src/Twilio/Rest/Accounts/V1/AuthTokenPromotionResource.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ public static AuthTokenPromotionResource Update(UpdateAuthTokenPromotionOptions
6666
/// <param name="client"> Client to make requests to Twilio </param>
6767
/// <returns> Task that resolves to A single instance of AuthTokenPromotion </returns>
6868
#if !NET35
69-
public static async System.Threading.Tasks.Task<AuthTokenPromotionResource> UpdateAsync(UpdateAuthTokenPromotionOptions options,
70-
ITwilioRestClient client = null)
69+
public static async System.Threading.Tasks.Task<AuthTokenPromotionResource> UpdateAsync(UpdateAuthTokenPromotionOptions options,
70+
ITwilioRestClient client = null,
71+
CancellationToken cancellationToken = default)
7172
{
7273
client = client ?? TwilioClient.GetRestClient();
73-
var response = await client.RequestAsync(BuildUpdateRequest(options, client));
74+
var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
7475
return FromJson(response.Content);
7576
}
7677
#endif
@@ -90,10 +91,11 @@ public static AuthTokenPromotionResource Update(
9091
/// <param name="client"> Client to make requests to Twilio </param>
9192
/// <returns> Task that resolves to A single instance of AuthTokenPromotion </returns>
9293
public static async System.Threading.Tasks.Task<AuthTokenPromotionResource> UpdateAsync(
93-
ITwilioRestClient client = null)
94+
ITwilioRestClient client = null,
95+
CancellationToken cancellationToken = default)
9496
{
9597
var options = new UpdateAuthTokenPromotionOptions(){ };
96-
return await UpdateAsync(options, client);
98+
return await UpdateAsync(options, client, cancellationToken);
9799
}
98100
#endif
99101

src/Twilio/Rest/Accounts/V1/BulkConsentsResource.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public static BulkConsentsResource Create(CreateBulkConsentsOptions options, ITw
6666
/// <param name="options"> Create BulkConsents parameters </param>
6767
/// <param name="client"> Client to make requests to Twilio </param>
6868
/// <returns> Task that resolves to A single instance of BulkConsents </returns>
69-
public static async System.Threading.Tasks.Task<BulkConsentsResource> CreateAsync(CreateBulkConsentsOptions options, ITwilioRestClient client = null)
69+
public static async System.Threading.Tasks.Task<BulkConsentsResource> CreateAsync(CreateBulkConsentsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7070
{
7171
client = client ?? TwilioClient.GetRestClient();
72-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
72+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7373
return FromJson(response.Content);
7474
}
7575
#endif
@@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task<BulkConsentsResource> CreateAsyn
9696
ITwilioRestClient client = null)
9797
{
9898
var options = new CreateBulkConsentsOptions(items){ };
99-
return await CreateAsync(options, client);
99+
return await CreateAsync(options, client, cancellationToken);
100100
}
101101
#endif
102102

src/Twilio/Rest/Accounts/V1/BulkContactsResource.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public static BulkContactsResource Create(CreateBulkContactsOptions options, ITw
6666
/// <param name="options"> Create BulkContacts parameters </param>
6767
/// <param name="client"> Client to make requests to Twilio </param>
6868
/// <returns> Task that resolves to A single instance of BulkContacts </returns>
69-
public static async System.Threading.Tasks.Task<BulkContactsResource> CreateAsync(CreateBulkContactsOptions options, ITwilioRestClient client = null)
69+
public static async System.Threading.Tasks.Task<BulkContactsResource> CreateAsync(CreateBulkContactsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7070
{
7171
client = client ?? TwilioClient.GetRestClient();
72-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
72+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7373
return FromJson(response.Content);
7474
}
7575
#endif
@@ -96,7 +96,7 @@ public static async System.Threading.Tasks.Task<BulkContactsResource> CreateAsyn
9696
ITwilioRestClient client = null)
9797
{
9898
var options = new CreateBulkContactsOptions(items){ };
99-
return await CreateAsync(options, client);
99+
return await CreateAsync(options, client, cancellationToken);
100100
}
101101
#endif
102102

src/Twilio/Rest/Accounts/V1/Credential/AwsResource.cs

+21-19
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public static AwsResource Create(CreateAwsOptions options, ITwilioRestClient cli
6666
/// <param name="options"> Create Aws parameters </param>
6767
/// <param name="client"> Client to make requests to Twilio </param>
6868
/// <returns> Task that resolves to A single instance of Aws </returns>
69-
public static async System.Threading.Tasks.Task<AwsResource> CreateAsync(CreateAwsOptions options, ITwilioRestClient client = null)
69+
public static async System.Threading.Tasks.Task<AwsResource> CreateAsync(CreateAwsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
7070
{
7171
client = client ?? TwilioClient.GetRestClient();
72-
var response = await client.RequestAsync(BuildCreateRequest(options, client));
72+
var response = await client.RequestAsync(BuildCreateRequest(options, client), cancellationToken);
7373
return FromJson(response.Content);
7474
}
7575
#endif
@@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task<AwsResource> CreateAsync(
104104
ITwilioRestClient client = null)
105105
{
106106
var options = new CreateAwsOptions(credentials){ FriendlyName = friendlyName, AccountSid = accountSid };
107-
return await CreateAsync(options, client);
107+
return await CreateAsync(options, client, cancellationToken);
108108
}
109109
#endif
110110

@@ -145,11 +145,12 @@ public static bool Delete(DeleteAwsOptions options, ITwilioRestClient client = n
145145
/// <param name="options"> Delete Aws parameters </param>
146146
/// <param name="client"> Client to make requests to Twilio </param>
147147
/// <returns> Task that resolves to A single instance of Aws </returns>
148-
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteAwsOptions options,
149-
ITwilioRestClient client = null)
148+
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteAwsOptions options,
149+
ITwilioRestClient client = null,
150+
CancellationToken cancellationToken = default)
150151
{
151152
client = client ?? TwilioClient.GetRestClient();
152-
var response = await client.RequestAsync(BuildDeleteRequest(options, client));
153+
var response = await client.RequestAsync(BuildDeleteRequest(options, client), cancellationToken);
153154
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
154155
}
155156
#endif
@@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null)
169170
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the AWS resource to delete. </param>
170171
/// <param name="client"> Client to make requests to Twilio </param>
171172
/// <returns> Task that resolves to A single instance of Aws </returns>
172-
public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathSid, ITwilioRestClient client = null)
173+
public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
173174
{
174175
var options = new DeleteAwsOptions(pathSid) ;
175-
return await DeleteAsync(options, client);
176+
return await DeleteAsync(options, client, cancellationToken);
176177
}
177178
#endif
178179

@@ -209,10 +210,10 @@ public static AwsResource Fetch(FetchAwsOptions options, ITwilioRestClient clien
209210
/// <param name="options"> Fetch Aws parameters </param>
210211
/// <param name="client"> Client to make requests to Twilio </param>
211212
/// <returns> Task that resolves to A single instance of Aws </returns>
212-
public static async System.Threading.Tasks.Task<AwsResource> FetchAsync(FetchAwsOptions options, ITwilioRestClient client = null)
213+
public static async System.Threading.Tasks.Task<AwsResource> FetchAsync(FetchAwsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
213214
{
214215
client = client ?? TwilioClient.GetRestClient();
215-
var response = await client.RequestAsync(BuildFetchRequest(options, client));
216+
var response = await client.RequestAsync(BuildFetchRequest(options, client), cancellationToken);
216217
return FromJson(response.Content);
217218
}
218219
#endif
@@ -233,10 +234,10 @@ public static AwsResource Fetch(
233234
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the AWS resource to fetch. </param>
234235
/// <param name="client"> Client to make requests to Twilio </param>
235236
/// <returns> Task that resolves to A single instance of Aws </returns>
236-
public static async System.Threading.Tasks.Task<AwsResource> FetchAsync(string pathSid, ITwilioRestClient client = null)
237+
public static async System.Threading.Tasks.Task<AwsResource> FetchAsync(string pathSid, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
237238
{
238239
var options = new FetchAwsOptions(pathSid){ };
239-
return await FetchAsync(options, client);
240+
return await FetchAsync(options, client, cancellationToken);
240241
}
241242
#endif
242243

@@ -271,10 +272,10 @@ public static ResourceSet<AwsResource> Read(ReadAwsOptions options, ITwilioRestC
271272
/// <param name="options"> Read Aws parameters </param>
272273
/// <param name="client"> Client to make requests to Twilio </param>
273274
/// <returns> Task that resolves to A single instance of Aws </returns>
274-
public static async System.Threading.Tasks.Task<ResourceSet<AwsResource>> ReadAsync(ReadAwsOptions options, ITwilioRestClient client = null)
275+
public static async System.Threading.Tasks.Task<ResourceSet<AwsResource>> ReadAsync(ReadAwsOptions options, ITwilioRestClient client = null, CancellationToken cancellationToken = default)
275276
{
276277
client = client ?? TwilioClient.GetRestClient();
277-
var response = await client.RequestAsync(BuildReadRequest(options, client));
278+
var response = await client.RequestAsync(BuildReadRequest(options, client), cancellationToken);
278279

279280
var page = Page<AwsResource>.FromJson("credentials", response.Content);
280281
return new ResourceSet<AwsResource>(page, options, client);
@@ -306,7 +307,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<AwsResource>> ReadAs
306307
ITwilioRestClient client = null)
307308
{
308309
var options = new ReadAwsOptions(){ PageSize = pageSize, Limit = limit};
309-
return await ReadAsync(options, client);
310+
return await ReadAsync(options, client, cancellationToken);
310311
}
311312
#endif
312313

@@ -393,11 +394,12 @@ public static AwsResource Update(UpdateAwsOptions options, ITwilioRestClient cli
393394
/// <param name="client"> Client to make requests to Twilio </param>
394395
/// <returns> Task that resolves to A single instance of Aws </returns>
395396
#if !NET35
396-
public static async System.Threading.Tasks.Task<AwsResource> UpdateAsync(UpdateAwsOptions options,
397-
ITwilioRestClient client = null)
397+
public static async System.Threading.Tasks.Task<AwsResource> UpdateAsync(UpdateAwsOptions options,
398+
ITwilioRestClient client = null,
399+
CancellationToken cancellationToken = default)
398400
{
399401
client = client ?? TwilioClient.GetRestClient();
400-
var response = await client.RequestAsync(BuildUpdateRequest(options, client));
402+
var response = await client.RequestAsync(BuildUpdateRequest(options, client), cancellationToken);
401403
return FromJson(response.Content);
402404
}
403405
#endif
@@ -428,7 +430,7 @@ public static async System.Threading.Tasks.Task<AwsResource> UpdateAsync(
428430
ITwilioRestClient client = null)
429431
{
430432
var options = new UpdateAwsOptions(pathSid){ FriendlyName = friendlyName };
431-
return await UpdateAsync(options, client);
433+
return await UpdateAsync(options, client, cancellationToken);
432434
}
433435
#endif
434436

0 commit comments

Comments
 (0)