/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListHostedZonesByNameResponse response = new ListHostedZonesByNameResponse(); UnmarshallResult(context,response); return response; }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListHostedZonesByNameResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) targetDepth += 1; while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("HostedZones/HostedZone", targetDepth)) { var unmarshaller = HostedZoneUnmarshaller.Instance; response.HostedZones.Add(unmarshaller.Unmarshall(context)); continue; } if (context.TestExpression("DNSName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DNSName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("HostedZoneId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.HostedZoneId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IsTruncated", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.IsTruncated = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextDNSName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextDNSName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextHostedZoneId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextHostedZoneId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("MaxItems", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.MaxItems = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }