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