@@ -66,10 +66,10 @@ public static AwsResource Create(CreateAwsOptions options, ITwilioRestClient cli
66
66
/// <param name="options"> Create Aws parameters </param>
67
67
/// <param name="client"> Client to make requests to Twilio </param>
68
68
/// <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 )
70
70
{
71
71
client = client ?? TwilioClient . GetRestClient ( ) ;
72
- var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) ) ;
72
+ var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) , cancellationToken ) ;
73
73
return FromJson ( response . Content ) ;
74
74
}
75
75
#endif
@@ -104,7 +104,7 @@ public static async System.Threading.Tasks.Task<AwsResource> CreateAsync(
104
104
ITwilioRestClient client = null )
105
105
{
106
106
var options = new CreateAwsOptions ( credentials ) { FriendlyName = friendlyName , AccountSid = accountSid } ;
107
- return await CreateAsync ( options , client ) ;
107
+ return await CreateAsync ( options , client , cancellationToken ) ;
108
108
}
109
109
#endif
110
110
@@ -145,11 +145,12 @@ public static bool Delete(DeleteAwsOptions options, ITwilioRestClient client = n
145
145
/// <param name="options"> Delete Aws parameters </param>
146
146
/// <param name="client"> Client to make requests to Twilio </param>
147
147
/// <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 )
150
151
{
151
152
client = client ?? TwilioClient . GetRestClient ( ) ;
152
- var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) ) ;
153
+ var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) , cancellationToken ) ;
153
154
return response . StatusCode == System . Net . HttpStatusCode . NoContent ;
154
155
}
155
156
#endif
@@ -169,10 +170,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null)
169
170
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the AWS resource to delete. </param>
170
171
/// <param name="client"> Client to make requests to Twilio </param>
171
172
/// <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 )
173
174
{
174
175
var options = new DeleteAwsOptions ( pathSid ) ;
175
- return await DeleteAsync ( options , client ) ;
176
+ return await DeleteAsync ( options , client , cancellationToken ) ;
176
177
}
177
178
#endif
178
179
@@ -209,10 +210,10 @@ public static AwsResource Fetch(FetchAwsOptions options, ITwilioRestClient clien
209
210
/// <param name="options"> Fetch Aws parameters </param>
210
211
/// <param name="client"> Client to make requests to Twilio </param>
211
212
/// <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 )
213
214
{
214
215
client = client ?? TwilioClient . GetRestClient ( ) ;
215
- var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) ) ;
216
+ var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) , cancellationToken ) ;
216
217
return FromJson ( response . Content ) ;
217
218
}
218
219
#endif
@@ -233,10 +234,10 @@ public static AwsResource Fetch(
233
234
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the AWS resource to fetch. </param>
234
235
/// <param name="client"> Client to make requests to Twilio </param>
235
236
/// <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 )
237
238
{
238
239
var options = new FetchAwsOptions ( pathSid ) { } ;
239
- return await FetchAsync ( options , client ) ;
240
+ return await FetchAsync ( options , client , cancellationToken ) ;
240
241
}
241
242
#endif
242
243
@@ -271,10 +272,10 @@ public static ResourceSet<AwsResource> Read(ReadAwsOptions options, ITwilioRestC
271
272
/// <param name="options"> Read Aws parameters </param>
272
273
/// <param name="client"> Client to make requests to Twilio </param>
273
274
/// <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 )
275
276
{
276
277
client = client ?? TwilioClient . GetRestClient ( ) ;
277
- var response = await client . RequestAsync ( BuildReadRequest ( options , client ) ) ;
278
+ var response = await client . RequestAsync ( BuildReadRequest ( options , client ) , cancellationToken ) ;
278
279
279
280
var page = Page < AwsResource > . FromJson ( "credentials" , response . Content ) ;
280
281
return new ResourceSet < AwsResource > ( page , options , client ) ;
@@ -306,7 +307,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<AwsResource>> ReadAs
306
307
ITwilioRestClient client = null )
307
308
{
308
309
var options = new ReadAwsOptions ( ) { PageSize = pageSize , Limit = limit } ;
309
- return await ReadAsync ( options , client ) ;
310
+ return await ReadAsync ( options , client , cancellationToken ) ;
310
311
}
311
312
#endif
312
313
@@ -393,11 +394,12 @@ public static AwsResource Update(UpdateAwsOptions options, ITwilioRestClient cli
393
394
/// <param name="client"> Client to make requests to Twilio </param>
394
395
/// <returns> Task that resolves to A single instance of Aws </returns>
395
396
#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 )
398
400
{
399
401
client = client ?? TwilioClient . GetRestClient ( ) ;
400
- var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) ) ;
402
+ var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) , cancellationToken ) ;
401
403
return FromJson ( response . Content ) ;
402
404
}
403
405
#endif
@@ -428,7 +430,7 @@ public static async System.Threading.Tasks.Task<AwsResource> UpdateAsync(
428
430
ITwilioRestClient client = null )
429
431
{
430
432
var options = new UpdateAwsOptions ( pathSid ) { FriendlyName = friendlyName } ;
431
- return await UpdateAsync ( options , client ) ;
433
+ return await UpdateAsync ( options , client , cancellationToken ) ;
432
434
}
433
435
#endif
434
436
0 commit comments