public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonDevOpsGuruConfig config = new AmazonDevOpsGuruConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonDevOpsGuruClient client = new AmazonDevOpsGuruClient(creds, config); ListNotificationChannelsResponse resp = new ListNotificationChannelsResponse(); do { ListNotificationChannelsRequest req = new ListNotificationChannelsRequest { NextToken = resp.NextToken }; resp = client.ListNotificationChannels(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Channels) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonDevOpsGuru CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonDevOpsGuruConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonDevOpsGuruClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }