/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { AuthorizeEndpointAccessResponse response = new AuthorizeEndpointAccessResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("AuthorizeEndpointAccessResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, AuthorizeEndpointAccessResponse response) { 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("AllowedAllVPCs", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.AllowedAllVPCs = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("AllowedVPCs/VpcIdentifier", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.AllowedVPCs.Add(item); continue; } if (context.TestExpression("AuthorizeTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.AuthorizeTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ClusterIdentifier", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ClusterIdentifier = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ClusterStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ClusterStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EndpointCount", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.EndpointCount = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Grantee", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Grantee = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Grantor", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Grantor = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } } } return; }