private static void UnmarshallResult(XmlUnmarshallerContext context, UploadServerCertificateResponse 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("ServerCertificateMetadata", targetDepth))
                    {
                        response.ServerCertificateMetadata = ServerCertificateMetadataUnmarshaller.GetInstance().Unmarshall(context);

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



            return;
        }
        public UploadServerCertificateResult Unmarshall(XmlUnmarshallerContext context)
        {
            UploadServerCertificateResult uploadServerCertificateResult = new UploadServerCertificateResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("ServerCertificateMetadata", targetDepth))
                    {
                        uploadServerCertificateResult.ServerCertificateMetadata = ServerCertificateMetadataUnmarshaller.GetInstance().Unmarshall(context);

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



            return(uploadServerCertificateResult);
        }
        public ServerCertificate Unmarshall(XmlUnmarshallerContext context)
        {
            ServerCertificate serverCertificate = new ServerCertificate();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("ServerCertificateMetadata", targetDepth))
                    {
                        serverCertificate.ServerCertificateMetadata = ServerCertificateMetadataUnmarshaller.GetInstance().Unmarshall(context);

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

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

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



            return(serverCertificate);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, ListServerCertificatesResponse 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("ServerCertificateMetadataList/member", targetDepth))
                    {
                        response.ServerCertificateMetadataList.Add(ServerCertificateMetadataUnmarshaller.GetInstance().Unmarshall(context));

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

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

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



            return;
        }