@@ -70,10 +70,10 @@ public static CredentialResource Create(CreateCredentialOptions options, ITwilio
7070 /// <param name="options"> Create Credential parameters </param>
7171 /// <param name="client"> Client to make requests to Twilio </param>
7272 /// <returns> Task that resolves to A single instance of Credential </returns>
73- public static async System . Threading . Tasks . Task < CredentialResource > CreateAsync ( CreateCredentialOptions options , ITwilioRestClient client = null )
73+ public static async System . Threading . Tasks . Task < CredentialResource > CreateAsync ( CreateCredentialOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
7474 {
7575 client = client ?? TwilioClient . GetRestClient ( ) ;
76- var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) ) ;
76+ var response = await client . RequestAsync ( BuildCreateRequest ( options , client ) , cancellationToken ) ;
7777 return FromJson ( response . Content ) ;
7878 }
7979 #endif
@@ -112,7 +112,7 @@ public static async System.Threading.Tasks.Task<CredentialResource> CreateAsync(
112112 ITwilioRestClient client = null )
113113 {
114114 var options = new CreateCredentialOptions ( pathCredentialListSid , username , password ) { PathAccountSid = pathAccountSid } ;
115- return await CreateAsync ( options , client ) ;
115+ return await CreateAsync ( options , client , cancellationToken ) ;
116116 }
117117 #endif
118118
@@ -157,11 +157,12 @@ public static bool Delete(DeleteCredentialOptions options, ITwilioRestClient cli
157157 /// <param name="options"> Delete Credential parameters </param>
158158 /// <param name="client"> Client to make requests to Twilio </param>
159159 /// <returns> Task that resolves to A single instance of Credential </returns>
160- public static async System . Threading . Tasks . Task < bool > DeleteAsync ( DeleteCredentialOptions options ,
161- ITwilioRestClient client = null )
160+ public static async System . Threading . Tasks . Task < bool > DeleteAsync ( DeleteCredentialOptions options ,
161+ ITwilioRestClient client = null ,
162+ CancellationToken cancellationToken = default )
162163 {
163164 client = client ?? TwilioClient . GetRestClient ( ) ;
164- var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) ) ;
165+ var response = await client . RequestAsync ( BuildDeleteRequest ( options , client ) , cancellationToken ) ;
165166 return response . StatusCode == System . Net . HttpStatusCode . NoContent ;
166167 }
167168 #endif
@@ -188,7 +189,7 @@ public static bool Delete(string pathCredentialListSid, string pathSid, string p
188189 public static async System . Threading . Tasks . Task < bool > DeleteAsync ( string pathCredentialListSid , string pathSid , string pathAccountSid = null , ITwilioRestClient client = null )
189190 {
190191 var options = new DeleteCredentialOptions ( pathCredentialListSid , pathSid ) { PathAccountSid = pathAccountSid } ;
191- return await DeleteAsync ( options , client ) ;
192+ return await DeleteAsync ( options , client , cancellationToken ) ;
192193 }
193194 #endif
194195
@@ -229,10 +230,10 @@ public static CredentialResource Fetch(FetchCredentialOptions options, ITwilioRe
229230 /// <param name="options"> Fetch Credential parameters </param>
230231 /// <param name="client"> Client to make requests to Twilio </param>
231232 /// <returns> Task that resolves to A single instance of Credential </returns>
232- public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( FetchCredentialOptions options , ITwilioRestClient client = null )
233+ public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( FetchCredentialOptions options , ITwilioRestClient client = null , CancellationToken cancellationToken = default )
233234 {
234235 client = client ?? TwilioClient . GetRestClient ( ) ;
235- var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) ) ;
236+ var response = await client . RequestAsync ( BuildFetchRequest ( options , client ) , cancellationToken ) ;
236237 return FromJson ( response . Content ) ;
237238 }
238239 #endif
@@ -262,7 +263,7 @@ public static CredentialResource Fetch(
262263 public static async System . Threading . Tasks . Task < CredentialResource > FetchAsync ( string pathCredentialListSid , string pathSid , string pathAccountSid = null , ITwilioRestClient client = null )
263264 {
264265 var options = new FetchCredentialOptions ( pathCredentialListSid , pathSid ) { PathAccountSid = pathAccountSid } ;
265- return await FetchAsync ( options , client ) ;
266+ return await FetchAsync ( options , client , cancellationToken ) ;
266267 }
267268 #endif
268269
@@ -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 ) ;
@@ -344,7 +345,7 @@ public static async System.Threading.Tasks.Task<ResourceSet<CredentialResource>>
344345 ITwilioRestClient client = null )
345346 {
346347 var options = new ReadCredentialOptions ( pathCredentialListSid ) { PathAccountSid = pathAccountSid , PageSize = pageSize , Limit = limit } ;
347- return await ReadAsync ( options , client ) ;
348+ return await ReadAsync ( options , client , cancellationToken ) ;
348349 }
349350 #endif
350351
@@ -435,11 +436,12 @@ public static CredentialResource Update(UpdateCredentialOptions options, ITwilio
435436 /// <param name="client"> Client to make requests to Twilio </param>
436437 /// <returns> Task that resolves to A single instance of Credential </returns>
437438 #if ! NET35
438- public static async System . Threading . Tasks . Task < CredentialResource > UpdateAsync ( UpdateCredentialOptions options ,
439- ITwilioRestClient client = null )
439+ public static async System . Threading . Tasks . Task < CredentialResource > UpdateAsync ( UpdateCredentialOptions options ,
440+ ITwilioRestClient client = null ,
441+ CancellationToken cancellationToken = default )
440442 {
441443 client = client ?? TwilioClient . GetRestClient ( ) ;
442- var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) ) ;
444+ var response = await client . RequestAsync ( BuildUpdateRequest ( options , client ) , cancellationToken ) ;
443445 return FromJson ( response . Content ) ;
444446 }
445447 #endif
@@ -478,7 +480,7 @@ public static async System.Threading.Tasks.Task<CredentialResource> UpdateAsync(
478480 ITwilioRestClient client = null )
479481 {
480482 var options = new UpdateCredentialOptions ( pathCredentialListSid , pathSid ) { PathAccountSid = pathAccountSid , Password = password } ;
481- return await UpdateAsync ( options , client ) ;
483+ return await UpdateAsync ( options , client , cancellationToken ) ;
482484 }
483485 #endif
484486
0 commit comments