public ComprehendClient(string endpoint) { AmazonComprehendConfig config = new AmazonComprehendConfig(); _client = new AmazonComprehendClient(config); _endpoint = endpoint; }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonComprehendConfig config = new AmazonComprehendConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonComprehendClient client = new AmazonComprehendClient(creds, config); ListTopicsDetectionJobsResponse resp = new ListTopicsDetectionJobsResponse(); do { ListTopicsDetectionJobsRequest req = new ListTopicsDetectionJobsRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListTopicsDetectionJobs(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.TopicsDetectionJobPropertiesList) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonComprehend CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonComprehendConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonComprehendClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }