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