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