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