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