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