Amazon.EC2.Model.Internal.MarshallTransformations.GetReservedInstancesExchangeQuoteResponseUnmarshaller.Unmarshall C# (CSharp) Метод

Unmarshall() публичный Метод

Unmarshaller the response from the service to the response class.
public Unmarshall ( Amazon.Runtime.Internal.Transform.XmlUnmarshallerContext context ) : AmazonWebServiceResponse
context Amazon.Runtime.Internal.Transform.XmlUnmarshallerContext
Результат Amazon.Runtime.AmazonWebServiceResponse
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            GetReservedInstancesExchangeQuoteResponse response = new GetReservedInstancesExchangeQuoteResponse();

            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("isValidExchange", targetDepth))
                    {
                        var unmarshaller = BoolUnmarshaller.Instance;
                        response.IsValidExchange = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("outputReservedInstancesWillExpireAt", targetDepth))
                    {
                        var unmarshaller = DateTimeUnmarshaller.Instance;
                        response.OutputReservedInstancesWillExpireAt = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("paymentDue", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.PaymentDue = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("reservedInstanceValueRollup", targetDepth))
                    {
                        var unmarshaller = ReservationValueUnmarshaller.Instance;
                        response.ReservedInstanceValueRollup = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("reservedInstanceValueSet/item", targetDepth))
                    {
                        var unmarshaller = ReservedInstanceReservationValueUnmarshaller.Instance;
                        var item = unmarshaller.Unmarshall(context);
                        response.ReservedInstanceValueSet.Add(item);
                        continue;
                    }
                    if (context.TestExpression("targetConfigurationValueRollup", targetDepth))
                    {
                        var unmarshaller = ReservationValueUnmarshaller.Instance;
                        response.TargetConfigurationValueRollup = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("targetConfigurationValueSet/item", targetDepth))
                    {
                        var unmarshaller = TargetReservationValueUnmarshaller.Instance;
                        var item = unmarshaller.Unmarshall(context);
                        response.TargetConfigurationValueSet.Add(item);
                        continue;
                    }
                    if (context.TestExpression("validationFailureReason", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ValidationFailureReason = unmarshaller.Unmarshall(context);
                        continue;
                    }
                } 
            }

            return response;
        }
GetReservedInstancesExchangeQuoteResponseUnmarshaller