/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListInstanceFleetsResponse response = new ListInstanceFleetsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("InstanceFleets", targetDepth)) { var unmarshaller = new ListUnmarshaller <InstanceFleet, InstanceFleetUnmarshaller>(InstanceFleetUnmarshaller.Instance); response.InstanceFleets = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Marker", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Marker = unmarshaller.Unmarshall(context); continue; } } return(response); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonElasticMapReduceConfig config = new AmazonElasticMapReduceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonElasticMapReduceClient client = new AmazonElasticMapReduceClient(creds, config); ListInstanceFleetsResponse resp = new ListInstanceFleetsResponse(); do { ListInstanceFleetsRequest req = new ListInstanceFleetsRequest { Marker = resp.Marker }; resp = client.ListInstanceFleets(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.InstanceFleets) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.Marker)); }