public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonIoTConfig config = new AmazonIoTConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonIoTClient client = new AmazonIoTClient(creds, config); ListActiveViolationsResponse resp = new ListActiveViolationsResponse(); do { ListActiveViolationsRequest req = new ListActiveViolationsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListActiveViolations(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ActiveViolations) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }