public static AccountWithRestoreAccessUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new AccountWithRestoreAccessUnmarshaller();
            }

            return(instance);
        }
Esempio n. 2
0
        public Snapshot Unmarshall(XmlUnmarshallerContext context)
        {
            Snapshot snapshot      = new Snapshot();
            int      originalDepth = context.CurrentDepth;
            int      targetDepth   = originalDepth + 1;

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

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("SnapshotIdentifier", targetDepth))
                    {
                        snapshot.SnapshotIdentifier = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ClusterIdentifier", targetDepth))
                    {
                        snapshot.ClusterIdentifier = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SnapshotCreateTime", targetDepth))
                    {
                        snapshot.SnapshotCreateTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Status", targetDepth))
                    {
                        snapshot.Status = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Port", targetDepth))
                    {
                        snapshot.Port = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("AvailabilityZone", targetDepth))
                    {
                        snapshot.AvailabilityZone = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ClusterCreateTime", targetDepth))
                    {
                        snapshot.ClusterCreateTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("MasterUsername", targetDepth))
                    {
                        snapshot.MasterUsername = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ClusterVersion", targetDepth))
                    {
                        snapshot.ClusterVersion = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SnapshotType", targetDepth))
                    {
                        snapshot.SnapshotType = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("NodeType", targetDepth))
                    {
                        snapshot.NodeType = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("NumberOfNodes", targetDepth))
                    {
                        snapshot.NumberOfNodes = IntUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("DBName", targetDepth))
                    {
                        snapshot.DBName = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("VpcId", targetDepth))
                    {
                        snapshot.VpcId = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Encrypted", targetDepth))
                    {
                        snapshot.Encrypted = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("EncryptedWithHSM", targetDepth))
                    {
                        snapshot.EncryptedWithHSM = BoolUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("AccountsWithRestoreAccess/AccountWithRestoreAccess", targetDepth))
                    {
                        snapshot.AccountsWithRestoreAccess.Add(AccountWithRestoreAccessUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("OwnerAccount", targetDepth))
                    {
                        snapshot.OwnerAccount = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("TotalBackupSizeInMegaBytes", targetDepth))
                    {
                        snapshot.TotalBackupSizeInMegaBytes = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ActualIncrementalBackupSizeInMegaBytes", targetDepth))
                    {
                        snapshot.ActualIncrementalBackupSizeInMegaBytes = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("BackupProgressInMegaBytes", targetDepth))
                    {
                        snapshot.BackupProgressInMegaBytes = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("CurrentBackupRateInMegaBytesPerSecond", targetDepth))
                    {
                        snapshot.CurrentBackupRateInMegaBytesPerSecond = DoubleUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("EstimatedSecondsToCompletion", targetDepth))
                    {
                        snapshot.EstimatedSecondsToCompletion = LongUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ElapsedTimeInSeconds", targetDepth))
                    {
                        snapshot.ElapsedTimeInSeconds = LongUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("SourceRegion", targetDepth))
                    {
                        snapshot.SourceRegion = StringUnmarshaller.GetInstance().Unmarshall(context);

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



            return(snapshot);
        }