Example #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)
        {
            CreateTrafficMirrorSessionResponse response = new CreateTrafficMirrorSessionResponse();

            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("clientToken", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.ClientToken = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("trafficMirrorSession", targetDepth))
                    {
                        var unmarshaller = TrafficMirrorSessionUnmarshaller.Instance;
                        response.TrafficMirrorSession = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return(response);
        }
        public static CreateTrafficMirrorSessionResponse Unmarshall(UnmarshallerContext _ctx)
        {
            CreateTrafficMirrorSessionResponse createTrafficMirrorSessionResponse = new CreateTrafficMirrorSessionResponse();

            createTrafficMirrorSessionResponse.HttpResponse           = _ctx.HttpResponse;
            createTrafficMirrorSessionResponse.RequestId              = _ctx.StringValue("CreateTrafficMirrorSession.RequestId");
            createTrafficMirrorSessionResponse.TrafficMirrorSessionId = _ctx.StringValue("CreateTrafficMirrorSession.TrafficMirrorSessionId");

            return(createTrafficMirrorSessionResponse);
        }