public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonMachineLearningConfig config = new AmazonMachineLearningConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonMachineLearningClient client = new AmazonMachineLearningClient(creds, config); DescribeMLModelsResponse resp = new DescribeMLModelsResponse(); do { DescribeMLModelsRequest req = new DescribeMLModelsRequest { NextToken = resp.NextToken , Limit = maxItems }; resp = client.DescribeMLModels(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Results) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
protected IAmazonMachineLearning CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonMachineLearningConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonMachineLearningClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return(client); }