Пример #1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DetectStackResourceDriftResponse response = new DetectStackResourceDriftResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("DetectStackResourceDriftResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
Пример #2
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, DetectStackResourceDriftResponse 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("StackResourceDrift", targetDepth))
                    {
                        var unmarshaller = StackResourceDriftUnmarshaller.Instance;
                        response.StackResourceDrift = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return;
        }
        public static DetectStackResourceDriftResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DetectStackResourceDriftResponse detectStackResourceDriftResponse = new DetectStackResourceDriftResponse();

            detectStackResourceDriftResponse.HttpResponse        = _ctx.HttpResponse;
            detectStackResourceDriftResponse.RequestId           = _ctx.StringValue("DetectStackResourceDrift.RequestId");
            detectStackResourceDriftResponse.DriftDetectionTime  = _ctx.StringValue("DetectStackResourceDrift.DriftDetectionTime");
            detectStackResourceDriftResponse.ResourceDriftStatus = _ctx.StringValue("DetectStackResourceDrift.ResourceDriftStatus");
            detectStackResourceDriftResponse.StackId             = _ctx.StringValue("DetectStackResourceDrift.StackId");
            detectStackResourceDriftResponse.ResourceType        = _ctx.StringValue("DetectStackResourceDrift.ResourceType");
            detectStackResourceDriftResponse.PhysicalResourceId  = _ctx.StringValue("DetectStackResourceDrift.PhysicalResourceId");
            detectStackResourceDriftResponse.LogicalResourceId   = _ctx.StringValue("DetectStackResourceDrift.LogicalResourceId");
            detectStackResourceDriftResponse.ActualProperties    = _ctx.StringValue("DetectStackResourceDrift.ActualProperties");
            detectStackResourceDriftResponse.ExpectedProperties  = _ctx.StringValue("DetectStackResourceDrift.ExpectedProperties");

            List <DetectStackResourceDriftResponse.DetectStackResourceDrift_PropertyDifference> detectStackResourceDriftResponse_propertyDifferences = new List <DetectStackResourceDriftResponse.DetectStackResourceDrift_PropertyDifference>();

            for (int i = 0; i < _ctx.Length("DetectStackResourceDrift.PropertyDifferences.Length"); i++)
            {
                DetectStackResourceDriftResponse.DetectStackResourceDrift_PropertyDifference propertyDifference = new DetectStackResourceDriftResponse.DetectStackResourceDrift_PropertyDifference();
                propertyDifference.PropertyPath   = _ctx.StringValue("DetectStackResourceDrift.PropertyDifferences[" + i + "].PropertyPath");
                propertyDifference.ActualValue    = _ctx.StringValue("DetectStackResourceDrift.PropertyDifferences[" + i + "].ActualValue");
                propertyDifference.ExpectedValue  = _ctx.StringValue("DetectStackResourceDrift.PropertyDifferences[" + i + "].ExpectedValue");
                propertyDifference.DifferenceType = _ctx.StringValue("DetectStackResourceDrift.PropertyDifferences[" + i + "].DifferenceType");

                detectStackResourceDriftResponse_propertyDifferences.Add(propertyDifference);
            }
            detectStackResourceDriftResponse.PropertyDifferences = detectStackResourceDriftResponse_propertyDifferences;

            return(detectStackResourceDriftResponse);
        }