public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { GetACLResponse response = new GetACLResponse(); while (context.Read()) { if (context.IsStartElement) { UnmarshallResult(context,response); continue; } } return response; }
private static void UnmarshallResult(XmlUnmarshallerContext context,GetACLResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) targetDepth += 2; while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Owner", targetDepth)) { if (null == response.AccessControlList) response.AccessControlList = new S3AccessControlList(); response.AccessControlList.Owner = OwnerUnmarshaller.Instance.Unmarshall(context); continue; } if (context.TestExpression("Grant", targetDepth + 1)) { if (null == response.AccessControlList) response.AccessControlList = new S3AccessControlList(); response.AccessControlList.Grants.Add(GrantUnmarshaller.Instance.Unmarshall(context)); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }