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