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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("SnapshotId", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.SnapshotId = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("VolumeARN", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.VolumeARN = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("VolumeRecoveryPointTime", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.VolumeRecoveryPointTime = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Пример #2
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            CreateSnapshotFromVolumeRecoveryPointResponse response = new CreateSnapshotFromVolumeRecoveryPointResponse();

            context.Read();

            UnmarshallResult(context, response);
            return(response);
        }
Пример #3
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            CreateSnapshotFromVolumeRecoveryPointResponse response = new CreateSnapshotFromVolumeRecoveryPointResponse();

            context.Read();

            response.CreateSnapshotFromVolumeRecoveryPointResult = CreateSnapshotFromVolumeRecoveryPointResultUnmarshaller.GetInstance().Unmarshall(context);

            return(response);
        }
Пример #4
0
        private static void UnmarshallResult(JsonUnmarshallerContext context, CreateSnapshotFromVolumeRecoveryPointResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

                if (context.TestExpression("VolumeARN", targetDepth))
                {
                    context.Read();
                    response.VolumeARN = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("VolumeRecoveryPointTime", targetDepth))
                {
                    context.Read();
                    response.VolumeRecoveryPointTime = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

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

            return;
        }