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