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