/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeGatewayInformationResponse response = new DescribeGatewayInformationResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("GatewayARN", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.GatewayARN = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GatewayId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.GatewayId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GatewayNetworkInterfaces", targetDepth)) { var unmarshaller = new ListUnmarshaller<NetworkInterface, NetworkInterfaceUnmarshaller>(NetworkInterfaceUnmarshaller.Instance); response.GatewayNetworkInterfaces = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GatewayState", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.GatewayState = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GatewayTimezone", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.GatewayTimezone = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GatewayType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.GatewayType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastSoftwareUpdate", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.LastSoftwareUpdate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextUpdateAvailabilityDate", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextUpdateAvailabilityDate = unmarshaller.Unmarshall(context); continue; } } return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeGatewayInformationResponse response = new DescribeGatewayInformationResponse(); context.Read(); UnmarshallResult(context,response); return response; }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeGatewayInformationResponse response = new DescribeGatewayInformationResponse(); context.Read(); response.DescribeGatewayInformationResult = DescribeGatewayInformationResultUnmarshaller.GetInstance().Unmarshall(context); return response; }
private static void UnmarshallResult(JsonUnmarshallerContext context,DescribeGatewayInformationResponse 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("GatewayId", targetDepth)) { context.Read(); response.GatewayId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("GatewayTimezone", targetDepth)) { context.Read(); response.GatewayTimezone = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("GatewayState", targetDepth)) { context.Read(); response.GatewayState = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("GatewayNetworkInterfaces", targetDepth)) { context.Read(); response.GatewayNetworkInterfaces = new List<NetworkInterface>(); NetworkInterfaceUnmarshaller unmarshaller = NetworkInterfaceUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.GatewayNetworkInterfaces.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.TestExpression("GatewayType", targetDepth)) { context.Read(); response.GatewayType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("NextUpdateAvailabilityDate", targetDepth)) { context.Read(); response.NextUpdateAvailabilityDate = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }