@@ -269,10 +269,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c
269269 /// <param name="options"> Create User parameters </param>
270270 /// <param name="client"> Client to make requests to Twilio </param>
271271 /// <returns> Task that resolves to A single instance of User </returns>
272- public static async System . Threading . Tasks . Task < UserResource > CreateAsync ( CreateUserOptions options , ITwilioRestClient client = null )
272+ public static async System . Threading . Tasks . Task < UserResource > CreateAsync ( CreateUserOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
273273 {
274274 client = client ?? TwilioClient . GetRestClient ( ) ;
275- var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) ) ;
275+ var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) , cancellationToken ) ;
276276 return FromJson ( response . Content ) ;
277277 }
278278 #endif
@@ -303,7 +303,7 @@ public static async System.Threading.Tasks.Task<UserResource> CreateAsync(
303303 ITwilioRestClient client = null )
304304 {
305305 var options = new CreateUserOptions ( pathOrganizationSid , scimUser ) { } ;
306- return await CreateAsync ( options , client ) ;
306+ return await CreateAsync ( options , client , cancellationToken ) ;
307307 }
308308 #endif
309309
@@ -346,11 +346,12 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client =
346346 /// <param name="options"> Delete User parameters </param>
347347 /// <param name="client"> Client to make requests to Twilio </param>
348348 /// <returns> Task that resolves to A single instance of User </returns>
349- public static async System . Threading . Tasks . Task < bool > DeleteAsync ( DeleteUserOptions options ,
350- ITwilioRestClient client = null )
349+ public static async System . Threading . Tasks . Task < bool > DeleteAsync ( DeleteUserOptions options ,
350+ ITwilioRestClient client = null ,
351+ CancellationToken cancellationToken = default )
351352 {
352353 client = client ?? TwilioClient . GetRestClient ( ) ;
353- var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) ) ;
354+ var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) , cancellationToken ) ;
354355 return response . StatusCode == System . Net . HttpStatusCode . NoContent ;
355356 }
356357 #endif
@@ -375,7 +376,7 @@ public static bool Delete(string pathOrganizationSid, string pathUserSid, ITwili
375376 public static async System . Threading . Tasks . Task < bool > DeleteAsync ( string pathOrganizationSid , string pathUserSid , ITwilioRestClient client = null )
376377 {
377378 var options = new DeleteUserOptions ( pathOrganizationSid , pathUserSid ) ;
378- return await DeleteAsync ( options , client ) ;
379+ return await DeleteAsync ( options , client , cancellationToken ) ;
379380 }
380381 #endif
381382
@@ -414,10 +415,10 @@ public static UserResource Fetch(FetchUserOptions options, ITwilioRestClient cli
414415 /// <param name="options"> Fetch User parameters </param>
415416 /// <param name="client"> Client to make requests to Twilio </param>
416417 /// <returns> Task that resolves to A single instance of User </returns>
417- public static async System . Threading . Tasks . Task < UserResource > FetchAsync ( FetchUserOptions options , ITwilioRestClient client = null )
418+ public static async System . Threading . Tasks . Task < UserResource > FetchAsync ( FetchUserOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
418419 {
419420 client = client ?? TwilioClient . GetRestClient ( ) ;
420- var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) ) ;
421+ var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) , cancellationToken ) ;
421422 return FromJson ( response . Content ) ;
422423 }
423424 #endif
@@ -444,7 +445,7 @@ public static UserResource Fetch(
444445 public static async System . Threading . Tasks . Task < UserResource > FetchAsync ( string pathOrganizationSid , string pathUserSid , ITwilioRestClient client = null )
445446 {
446447 var options = new FetchUserOptions ( pathOrganizationSid , pathUserSid ) { } ;
447- return await FetchAsync ( options , client ) ;
448+ return await FetchAsync ( options , client , cancellationToken ) ;
448449 }
449450 #endif
450451
@@ -481,10 +482,10 @@ public static ResourceSet<UserResource> Read(ReadUserOptions options, ITwilioRes
481482 /// <param name="options"> Read User parameters </param>
482483 /// <param name="client"> Client to make requests to Twilio </param>
483484 /// <returns> Task that resolves to A single instance of User </returns>
484- public static async System . Threading . Tasks . Task < ResourceSet < UserResource > > ReadAsync ( ReadUserOptions options , ITwilioRestClient client = null )
485+ public static async System . Threading . Tasks . Task < ResourceSet < UserResource > > ReadAsync ( ReadUserOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
485486 {
486487 client = client ?? TwilioClient . GetRestClient ( ) ;
487- var response = await client . RequestAsync ( BuildReadRequest ( options , client ) ) ;
488+ var response = await client . RequestAsync ( BuildReadRequest ( options , client ) , cancellationToken ) ;
488489
489490 var page = Page < UserResource > . FromJson ( "Resources" , response . Content ) ;
490491 return new ResourceSet < UserResource > ( page , options , client ) ;
@@ -520,7 +521,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<UserResource>> ReadA
520521 ITwilioRestClient client = null )
521522 {
522523 var options = new ReadUserOptions ( pathOrganizationSid ) { Filter = filter , Limit = limit } ;
523- return await ReadAsync ( options , client ) ;
524+ return await ReadAsync ( options , client , cancellationToken ) ;
524525 }
525526 #endif
526527
@@ -610,11 +611,12 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c
610611 /// <param name="client"> Client to make requests to Twilio </param>
611612 /// <returns> Task that resolves to A single instance of User </returns>
612613 #if ! NET35
613- public static async System . Threading . Tasks . Task < UserResource > UpdateAsync ( UpdateUserOptions options ,
614- ITwilioRestClient client = null )
614+ public static async System . Threading . Tasks . Task < UserResource > UpdateAsync ( UpdateUserOptions options ,
615+ ITwilioRestClient client = null ,
616+ CancellationToken cancellationToken = default )
615617 {
616618 client = client ?? TwilioClient . GetRestClient ( ) ;
617- var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) ) ;
619+ var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) , cancellationToken ) ;
618620 return FromJson ( response . Content ) ;
619621 }
620622 #endif
@@ -653,7 +655,7 @@ public static async System.Threading.Tasks.Task<UserResource> UpdateAsync(
653655 ITwilioRestClient client = null )
654656 {
655657 var options = new UpdateUserOptions ( pathOrganizationSid , pathUserSid , scimUser ) { IfMatch = ifMatch } ;
656- return await UpdateAsync ( options , client ) ;
658+ return await UpdateAsync ( options , client , cancellationToken ) ;
657659 }
658660 #endif
659661
0 commit comments