public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
GetHostReservationPurchasePreviewResponse response = new GetHostReservationPurchasePreviewResponse();
int originalDepth = context.CurrentDepth;
int targetDepth = originalDepth + 1;
if (context.IsStartOfDocument)
targetDepth = 2;
while (context.ReadAtDepth(originalDepth))
{
if (context.IsStartElement || context.IsAttribute)
{
if (context.TestExpression("currencyCode", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.CurrencyCode = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("purchase/member", targetDepth))
{
var unmarshaller = PurchaseUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
response.Purchase.Add(item);
continue;
}
if (context.TestExpression("totalHourlyPrice", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.TotalHourlyPrice = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("totalUpfrontPrice", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.TotalUpfrontPrice = unmarshaller.Unmarshall(context);
continue;
}
}
}
return response;
}