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