private static void UnmarshallResult(JsonUnmarshallerContext context,CreateInterconnectResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("interconnectId", targetDepth)) { context.Read(); response.InterconnectId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("interconnectName", targetDepth)) { context.Read(); response.InterconnectName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("interconnectState", targetDepth)) { context.Read(); response.InterconnectState = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("region", targetDepth)) { context.Read(); response.Region = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("location", targetDepth)) { context.Read(); response.Location = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("bandwidth", targetDepth)) { context.Read(); response.Bandwidth = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateInterconnectResponse response = new CreateInterconnectResponse(); context.Read(); UnmarshallResult(context,response); return response; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateInterconnectResponse response = new CreateInterconnectResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("bandwidth", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Bandwidth = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("interconnectId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.InterconnectId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("interconnectName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.InterconnectName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("interconnectState", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.InterconnectState = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("loaIssueTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LoaIssueTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("location", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Location = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("region", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Region = unmarshaller.Unmarshall(context); continue; } } return response; }