public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeBatchPredictionsResponse response = new DescribeBatchPredictionsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Results", targetDepth)) { var unmarshaller = new ListUnmarshaller <BatchPrediction, BatchPredictionUnmarshaller>(BatchPredictionUnmarshaller.Instance); response.Results = unmarshaller.Unmarshall(context); continue; } } return(response); }
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); DescribeBatchPredictionsResponse resp = new DescribeBatchPredictionsResponse(); do { DescribeBatchPredictionsRequest req = new DescribeBatchPredictionsRequest { NextToken = resp.NextToken , Limit = maxItems }; resp = client.DescribeBatchPredictions(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Results) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }