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