/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListActivitiesResponse response = new ListActivitiesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("activities", targetDepth)) { var unmarshaller = new ListUnmarshaller <ActivityListItem, ActivityListItemUnmarshaller>(ActivityListItemUnmarshaller.Instance); response.Activities = 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) { AmazonStepFunctionsConfig config = new AmazonStepFunctionsConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonStepFunctionsClient client = new AmazonStepFunctionsClient(creds, config); ListActivitiesResponse resp = new ListActivitiesResponse(); do { ListActivitiesRequest req = new ListActivitiesRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListActivities(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Activities) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }