@@ -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