private static void UnmarshallResult(XmlUnmarshallerContext context, DescribeStackResourceResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("StackResourceDetail", targetDepth))
                    {
                        response.StackResourceDetail = StackResourceDetailUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }



            return;
        }
        /// <summary>
        /// <para> Returns the description for the specified resource in the specified stack. </para> <para>For deleted stacks, DescribeStackResource
        /// returns resource information for up to 90 days after the stack has been deleted. </para> <para> You must specify <c>StackName</c> and
        /// <c>LogicalResourceId</c> .
        /// </para>
        /// </summary>
        ///
        /// <param name="describeStackResourceRequest">Container for the necessary parameters to execute the DescribeStackResource service method on
        ///           AmazonCloudFormation.</param>
        ///
        /// <returns>The response from the DescribeStackResource service method, as returned by AmazonCloudFormation.</returns>
        ///
        public DescribeStackResourceResponse DescribeStackResource(DescribeStackResourceRequest describeStackResourceRequest)
        {
            IRequest <DescribeStackResourceRequest> request  = new DescribeStackResourceRequestMarshaller().Marshall(describeStackResourceRequest);
            DescribeStackResourceResponse           response = Invoke <DescribeStackResourceRequest, DescribeStackResourceResponse> (request, this.signer, DescribeStackResourceResponseUnmarshaller.GetInstance());

            return(response);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeStackResourceResponse response = new DescribeStackResourceResponse();

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

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

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

            return(response);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeStackResourceResponse response = new DescribeStackResourceResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("DescribeStackResourceResult", 2))
                    {
                        response.DescribeStackResourceResult = DescribeStackResourceResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }