@@ -80,10 +80,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio
8080 /// <param name="options"> Create Credential parameters </param>
8181 /// <param name="client"> Client to make requests to Twilio </param>
8282 /// <returns> Task that resolves to A single instance of Credential </returns>
83- public static async System . Threading . Tasks . Task < CredentialResource > CreateAsync ( CreateCredentialOptions options , ITwilioRestClient client = null )
83+ public static async System . Threading . Tasks . Task < CredentialResource > CreateAsync ( CreateCredentialOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
8484 {
8585 client = client ?? TwilioClient . GetRestClient ( ) ;
86- var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) ) ;
86+ var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) , cancellationToken ) ;
8787 return FromJson ( response . Content ) ;
8888 }
8989 #endif
@@ -134,7 +134,7 @@ public static async System.Threading.Tasks.Task<CredentialResource> CreateAsync(
134134 ITwilioRestClient client = null )
135135 {
136136 var options = new CreateCredentialOptions ( type ) { FriendlyName = friendlyName , Certificate = certificate , PrivateKey = privateKey , Sandbox = sandbox , ApiKey = apiKey , Secret = secret } ;
137- return await CreateAsync ( options , client ) ;
137+ return await CreateAsync ( options , client , cancellationToken ) ;
138138 }
139139 #endif
140140
@@ -175,11 +175,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli
175175 /// <param name="options"> Delete Credential parameters </param>
176176 /// <param name="client"> Client to make requests to Twilio </param>
177177 /// <returns> Task that resolves to A single instance of Credential </returns>
178- public static async System . Threading . Tasks . Task < bool > DeleteAsync ( DeleteCredentialOptions options ,
179- ITwilioRestClient client = null )
178+ public static async System . Threading . Tasks . Task < bool > DeleteAsync ( DeleteCredentialOptions options ,
179+ ITwilioRestClient client = null ,
180+ CancellationToken cancellationToken = default )
180181 {
181182 client = client ?? TwilioClient . GetRestClient ( ) ;
182- var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) ) ;
183+ var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) , cancellationToken ) ;
183184 return response . StatusCode == System . Net . HttpStatusCode . NoContent ;
184185 }
185186 #endif
@@ -199,10 +200,10 @@ public static bool Delete(string pathSid, ITwilioRestClient client = null)
199200 /// <param name="pathSid"> The Twilio-provided string that uniquely identifies the Credential resource to delete. </param>
200201 /// <param name="client"> Client to make requests to Twilio </param>
201202 /// <returns> Task that resolves to A single instance of Credential </returns>
202- public static async System . Threading . Tasks . Task < bool > DeleteAsync ( string pathSid , ITwilioRestClient client = null )
203+ public static async System . Threading . Tasks . Task < bool > DeleteAsync ( string pathSid , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
203204 {
204205 var options = new DeleteCredentialOptions ( pathSid ) ;
205- return await DeleteAsync ( options , client ) ;
206+ return await DeleteAsync ( options , client , cancellationToken ) ;
206207 }
207208 #endif
208209
@@ -239,10 +240,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe
239240 /// <param name="options"> Fetch Credential parameters </param>
240241 /// <param name="client"> Client to make requests to Twilio </param>
241242 /// <returns> Task that resolves to A single instance of Credential </returns>
242- public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( FetchCredentialOptions options , ITwilioRestClient client = null )
243+ public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( FetchCredentialOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
243244 {
244245 client = client ?? TwilioClient . GetRestClient ( ) ;
245- var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) ) ;
246+ var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) , cancellationToken ) ;
246247 return FromJson ( response . Content ) ;
247248 }
248249 #endif
@@ -263,10 +264,10 @@ public static CredentialResource Fetch(
263264 /// <param name="pathSid"> The Twilio-provided string that uniquely identifies the Credential resource to fetch. </param>
264265 /// <param name="client"> Client to make requests to Twilio </param>
265266 /// <returns> Task that resolves to A single instance of Credential </returns>
266- public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( string pathSid , ITwilioRestClient client = null )
267+ public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( string pathSid , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
267268 {
268269 var options = new FetchCredentialOptions ( pathSid ) { } ;
269- return await FetchAsync ( options , client ) ;
270+ return await FetchAsync ( options , client , cancellationToken ) ;
270271 }
271272 #endif
272273
@@ -301,10 +302,10 @@ public static ResourceSet<CredentialResource> Read(ReadCredentialOptions options
301302 /// <param name="options"> Read Credential parameters </param>
302303 /// <param name="client"> Client to make requests to Twilio </param>
303304 /// <returns> Task that resolves to A single instance of Credential </returns>
304- public static async System . Threading . Tasks . Task < ResourceSet < CredentialResource > > ReadAsync ( ReadCredentialOptions options , ITwilioRestClient client = null )
305+ public static async System . Threading . Tasks . Task < ResourceSet < CredentialResource > > ReadAsync ( ReadCredentialOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
305306 {
306307 client = client ?? TwilioClient . GetRestClient ( ) ;
307- var response = await client . RequestAsync ( BuildReadRequest ( options , client ) ) ;
308+ var response = await client . RequestAsync ( BuildReadRequest ( options , client ) , cancellationToken ) ;
308309
309310 var page = Page < CredentialResource > . FromJson ( "credentials" , response . Content ) ;
310311 return new ResourceSet < CredentialResource > ( page , options , client ) ;
@@ -336,7 +337,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<CredentialResource>>
336337 ITwilioRestClient client = null )
337338 {
338339 var options = new ReadCredentialOptions ( ) { PageSize = pageSize , Limit = limit } ;
339- return await ReadAsync ( options , client ) ;
340+ return await ReadAsync ( options , client , cancellationToken ) ;
340341 }
341342 #endif
342343
@@ -423,11 +424,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio
423424 /// <param name="client"> Client to make requests to Twilio </param>
424425 /// <returns> Task that resolves to A single instance of Credential </returns>
425426 #if ! NET35
426- public static async System . Threading . Tasks . Task < CredentialResource > UpdateAsync ( UpdateCredentialOptions options ,
427- ITwilioRestClient client = null )
427+ public static async System . Threading . Tasks . Task < CredentialResource > UpdateAsync ( UpdateCredentialOptions options ,
428+ ITwilioRestClient client = null ,
429+ CancellationToken cancellationToken = default )
428430 {
429431 client = client ?? TwilioClient . GetRestClient ( ) ;
430- var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) ) ;
432+ var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) , cancellationToken ) ;
431433 return FromJson ( response . Content ) ;
432434 }
433435 #endif
@@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task<CredentialResource> UpdateAsync(
478480 ITwilioRestClient client = null )
479481 {
480482 var options = new UpdateCredentialOptions ( pathSid ) { FriendlyName = friendlyName , Certificate = certificate , PrivateKey = privateKey , Sandbox = sandbox , ApiKey = apiKey , Secret = secret } ;
481- return await UpdateAsync ( options , client ) ;
483+ return await UpdateAsync ( options , client , cancellationToken ) ;
482484 }
483485 #endif
484486
0 commit comments