private static void UnmarshallResult(XmlUnmarshallerContext context, GetAccessPointResponse 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("Bucket", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Bucket = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CreationDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Name", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Name = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NetworkOrigin", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NetworkOrigin = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("PublicAccessBlockConfiguration", targetDepth)) { var unmarshaller = PublicAccessBlockConfigurationUnmarshaller.Instance; response.PublicAccessBlockConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("VpcConfiguration", targetDepth)) { var unmarshaller = VpcConfigurationUnmarshaller.Instance; response.VpcConfiguration = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { GetAccessPointResponse response = new GetAccessPointResponse(); UnmarshallResult(context, response); return(response); }