public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonDetectiveConfig config = new AmazonDetectiveConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonDetectiveClient client = new AmazonDetectiveClient(creds, config); ListGraphsResponse resp = new ListGraphsResponse(); do { ListGraphsRequest req = new ListGraphsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListGraphs(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.GraphList) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonDetective CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonDetectiveConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonDetectiveClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }