private static void UnmarshallResult(JsonUnmarshallerContext context,DescribeWorkingStorageResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("GatewayARN", targetDepth)) { context.Read(); response.GatewayARN = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("DiskIds", targetDepth)) { context.Read(); response.DiskIds = new List<String>(); StringUnmarshaller unmarshaller = StringUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.DiskIds.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("WorkingStorageUsedInBytes", targetDepth)) { context.Read(); response.WorkingStorageUsedInBytes = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("WorkingStorageAllocatedInBytes", targetDepth)) { context.Read(); response.WorkingStorageAllocatedInBytes = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeWorkingStorageResponse response = new DescribeWorkingStorageResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeWorkingStorageResponse response = new DescribeWorkingStorageResponse(); context.Read(); response.DescribeWorkingStorageResult = DescribeWorkingStorageResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeWorkingStorageResponse response = new DescribeWorkingStorageResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("GatewayARN", targetDepth)) { response.GatewayARN = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("DiskIds", targetDepth)) { var unmarshaller = new ListUnmarshaller<String,StringUnmarshaller>( StringUnmarshaller.GetInstance()); response.DiskIds = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("WorkingStorageUsedInBytes", targetDepth)) { response.WorkingStorageUsedInBytes = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("WorkingStorageAllocatedInBytes", targetDepth)) { response.WorkingStorageAllocatedInBytes = LongUnmarshaller.GetInstance().Unmarshall(context); continue; } } return response; }