public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListLocalDisksResponse response = new ListLocalDisksResponse(); 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("Disks", targetDepth)) { var unmarshaller = new ListUnmarshaller<Disk,DiskUnmarshaller>( DiskUnmarshaller.GetInstance()); response.Disks = unmarshaller.Unmarshall(context); continue; } } return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListLocalDisksResponse response = new ListLocalDisksResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListLocalDisksResponse response = new ListLocalDisksResponse(); context.Read(); response.ListLocalDisksResult = ListLocalDisksResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
private static void UnmarshallResult(JsonUnmarshallerContext context,ListLocalDisksResponse 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("Disks", targetDepth)) { context.Read(); response.Disks = new List<Disk>(); DiskUnmarshaller unmarshaller = DiskUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.Disks.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }