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