22using System . Collections . Generic ;
33using System . Linq ;
44using System . Text ;
5+ using System . Threading ;
56using System . Threading . Tasks ;
67using MailChimp . Net . Core ;
78using MailChimp . Net . Core . Requests ;
@@ -18,22 +19,22 @@ public ConnectedWebsiteLogic(MailChimpOptions mailChimpConfiguration)
1819 {
1920 }
2021
21- public async Task < Site > AddAsync ( string foreignId , string domain )
22+ public async Task < Site > AddAsync ( string foreignId , string domain , CancellationToken cancellationToken = default )
2223 {
2324 using var client = CreateMailClient ( "/connected-sites" ) ;
2425
2526 var postRequst = new ConnectedWebsiteRequest { domain = domain , foreign_id = foreignId } ;
26- var response = await client . PostAsJsonAsync ( "" , postRequst ) . ConfigureAwait ( false ) ;
27+ var response = await client . PostAsJsonAsync ( "" , postRequst , cancellationToken ) . ConfigureAwait ( false ) ;
2728 await response . EnsureSuccessMailChimpAsync ( ) . ConfigureAwait ( false ) ;
2829
2930 return await response . Content . ReadAsAsync < Site > ( ) . ConfigureAwait ( false ) ;
3031 }
3132
32- public async Task < IEnumerable < Site > > GetAllAsync ( )
33+ public async Task < IEnumerable < Site > > GetAllAsync ( CancellationToken cancellationToken = default )
3334 {
3435 using var client = CreateMailClient ( "/connected-sites" ) ;
3536
36- var response = await client . GetAsync ( "" ) ;
37+ var response = await client . GetAsync ( "" , cancellationToken ) ;
3738 await response . EnsureSuccessMailChimpAsync ( ) ;
3839
3940 var appResponse = await response . Content . ReadAsAsync < ConnectedWebsiteResponse > ( ) . ConfigureAwait ( false ) ;
0 commit comments