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