public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonResourceGroupsConfig config = new AmazonResourceGroupsConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonResourceGroupsClient client = new AmazonResourceGroupsClient(creds, config); ListGroupResourcesResponse resp = new ListGroupResourcesResponse(); do { ListGroupResourcesRequest req = new ListGroupResourcesRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListGroupResources(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.ResourceIdentifiers) { AddObject(obj); } foreach (var obj in resp.QueryErrors) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonResourceGroups CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonResourceGroupsConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonResourceGroupsClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }