public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonPollyConfig config = new AmazonPollyConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonPollyClient client = new AmazonPollyClient(creds, config); ListSpeechSynthesisTasksResponse resp = new ListSpeechSynthesisTasksResponse(); do { ListSpeechSynthesisTasksRequest req = new ListSpeechSynthesisTasksRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListSpeechSynthesisTasks(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.SynthesisTasks) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }