@@ -269,10 +269,10 @@ public static UserResource Create(CreateUserOptions options, ITwilioRestClient c
269
269
/// <param name="options"> Create User parameters </param>
270
270
/// <param name="client"> Client to make requests to Twilio </param>
271
271
/// <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 )
273
273
{
274
274
client = client ?? TwilioClient . GetRestClient ( ) ;
275
- var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) ) ;
275
+ var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) , cancellationToken ) ;
276
276
return FromJson ( response . Content ) ;
277
277
}
278
278
#endif
@@ -303,7 +303,7 @@ public static async System.Threading.Tasks.Task<UserResource> CreateAsync(
303
303
ITwilioRestClient client = null )
304
304
{
305
305
var options = new CreateUserOptions ( pathOrganizationSid , scimUser ) { } ;
306
- return await CreateAsync ( options , client ) ;
306
+ return await CreateAsync ( options , client , cancellationToken ) ;
307
307
}
308
308
#endif
309
309
@@ -346,11 +346,12 @@ public static bool Delete(DeleteUserOptions options, ITwilioRestClient client =
346
346
/// <param name="options"> Delete User parameters </param>
347
347
/// <param name="client"> Client to make requests to Twilio </param>
348
348
/// <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 )
351
352
{
352
353
client = client ?? TwilioClient . GetRestClient ( ) ;
353
- var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) ) ;
354
+ var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) , cancellationToken ) ;
354
355
return response . StatusCode == System . Net . HttpStatusCode . NoContent ;
355
356
}
356
357
#endif
@@ -375,7 +376,7 @@ public static bool Delete(string pathOrganizationSid, string pathUserSid, ITwili
375
376
public static async System . Threading . Tasks . Task < bool > DeleteAsync ( string pathOrganizationSid , string pathUserSid , ITwilioRestClient client = null )
376
377
{
377
378
var options = new DeleteUserOptions ( pathOrganizationSid , pathUserSid ) ;
378
- return await DeleteAsync ( options , client ) ;
379
+ return await DeleteAsync ( options , client , cancellationToken ) ;
379
380
}
380
381
#endif
381
382
@@ -414,10 +415,10 @@ public static UserResource Fetch(FetchUserOptions options, ITwilioRestClient cli
414
415
/// <param name="options"> Fetch User parameters </param>
415
416
/// <param name="client"> Client to make requests to Twilio </param>
416
417
/// <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 )
418
419
{
419
420
client = client ?? TwilioClient . GetRestClient ( ) ;
420
- var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) ) ;
421
+ var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) , cancellationToken ) ;
421
422
return FromJson ( response . Content ) ;
422
423
}
423
424
#endif
@@ -444,7 +445,7 @@ public static UserResource Fetch(
444
445
public static async System . Threading . Tasks . Task < UserResource > FetchAsync ( string pathOrganizationSid , string pathUserSid , ITwilioRestClient client = null )
445
446
{
446
447
var options = new FetchUserOptions ( pathOrganizationSid , pathUserSid ) { } ;
447
- return await FetchAsync ( options , client ) ;
448
+ return await FetchAsync ( options , client , cancellationToken ) ;
448
449
}
449
450
#endif
450
451
@@ -481,10 +482,10 @@ public static ResourceSet<UserResource> Read(ReadUserOptions options, ITwilioRes
481
482
/// <param name="options"> Read User parameters </param>
482
483
/// <param name="client"> Client to make requests to Twilio </param>
483
484
/// <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 )
485
486
{
486
487
client = client ?? TwilioClient . GetRestClient ( ) ;
487
- var response = await client . RequestAsync ( BuildReadRequest ( options , client ) ) ;
488
+ var response = await client . RequestAsync ( BuildReadRequest ( options , client ) , cancellationToken ) ;
488
489
489
490
var page = Page < UserResource > . FromJson ( "Resources" , response . Content ) ;
490
491
return new ResourceSet < UserResource > ( page , options , client ) ;
@@ -520,7 +521,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<UserResource>> ReadA
520
521
ITwilioRestClient client = null )
521
522
{
522
523
var options = new ReadUserOptions ( pathOrganizationSid ) { Filter = filter , Limit = limit } ;
523
- return await ReadAsync ( options , client ) ;
524
+ return await ReadAsync ( options , client , cancellationToken ) ;
524
525
}
525
526
#endif
526
527
@@ -610,11 +611,12 @@ public static UserResource Update(UpdateUserOptions options, ITwilioRestClient c
610
611
/// <param name="client"> Client to make requests to Twilio </param>
611
612
/// <returns> Task that resolves to A single instance of User </returns>
612
613
#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 )
615
617
{
616
618
client = client ?? TwilioClient . GetRestClient ( ) ;
617
- var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) ) ;
619
+ var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) , cancellationToken ) ;
618
620
return FromJson ( response . Content ) ;
619
621
}
620
622
#endif
@@ -653,7 +655,7 @@ public static async System.Threading.Tasks.Task<UserResource> UpdateAsync(
653
655
ITwilioRestClient client = null )
654
656
{
655
657
var options = new UpdateUserOptions ( pathOrganizationSid , pathUserSid , scimUser ) { IfMatch = ifMatch } ;
656
- return await UpdateAsync ( options , client ) ;
658
+ return await UpdateAsync ( options , client , cancellationToken ) ;
657
659
}
658
660
#endif
659
661
0 commit comments