public static SelfUserProfileUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new SelfUserProfileUnmarshaller();
     }
     return(instance);
 }
Example #2
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeMyUserProfileResponse response = new DescribeMyUserProfileResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("UserProfile", targetDepth))
                {
                    response.UserProfile = SelfUserProfileUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Example #3
0
        private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeMyUserProfileResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("UserProfile", targetDepth))
                {
                    context.Read();
                    response.UserProfile = SelfUserProfileUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return;
                }
            }

            return;
        }