/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ImportInstallationMediaResponse response = new ImportInstallationMediaResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("ImportInstallationMediaResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ImportInstallationMediaResponse 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("CustomAvailabilityZoneId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CustomAvailabilityZoneId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Engine", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Engine = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EngineInstallationMediaPath", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.EngineInstallationMediaPath = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EngineVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.EngineVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FailureCause", targetDepth)) { var unmarshaller = InstallationMediaFailureCauseUnmarshaller.Instance; response.FailureCause = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("InstallationMediaId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.InstallationMediaId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("OSInstallationMediaPath", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.OSInstallationMediaPath = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Status", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Status = unmarshaller.Unmarshall(context); continue; } } } return; }