/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeFleetCapacityResponse response = new DescribeFleetCapacityResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("FleetCapacity", targetDepth)) { var unmarshaller = new ListUnmarshaller <FleetCapacity, FleetCapacityUnmarshaller>(FleetCapacityUnmarshaller.Instance); response.FleetCapacity = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return(response); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonGameLiftConfig config = new AmazonGameLiftConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonGameLiftClient client = new AmazonGameLiftClient(creds, config); DescribeFleetCapacityResponse resp = new DescribeFleetCapacityResponse(); do { DescribeFleetCapacityRequest req = new DescribeFleetCapacityRequest { NextToken = resp.NextToken , Limit = maxItems }; resp = client.DescribeFleetCapacity(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.FleetCapacity) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }