public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonGreengrassV2Config config = new AmazonGreengrassV2Config(); config.RegionEndpoint = region; ConfigureClient(config); AmazonGreengrassV2Client client = new AmazonGreengrassV2Client(creds, config); ListDeploymentsResponse resp = new ListDeploymentsResponse(); do { ListDeploymentsRequest req = new ListDeploymentsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListDeployments(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Deployments) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }