Exemplo n.º 1
0
        public static AccessKeyMetadataUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new AccessKeyMetadataUnmarshaller();
            }

            return(instance);
        }
        public ListAccessKeysResult Unmarshall(UnmarshallerContext context)
        {
            ListAccessKeysResult listAccessKeysResult = new ListAccessKeysResult();
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("AccessKeyMetadata/member", targetDepth))
                    {
                        listAccessKeysResult.AccessKeyMetadata.Add(AccessKeyMetadataUnmarshaller.GetInstance().Unmarshall(context));

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

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

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

            return(listAccessKeysResult);
        }