Exemple #1
0
        public GetRoleResult Unmarshall(XmlUnmarshallerContext context)
        {
            GetRoleResult getRoleResult = new GetRoleResult();
            int           originalDepth = context.CurrentDepth;
            int           targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Role", targetDepth))
                    {
                        getRoleResult.Role = RoleUnmarshaller.GetInstance().Unmarshall(context);

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



            return(getRoleResult);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetRoleResponse 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("Role", targetDepth))
                    {
                        response.Role = RoleUnmarshaller.GetInstance().Unmarshall(context);

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



            return;
        }
Exemple #3
0
        public static RoleUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new RoleUnmarshaller();
            }

            return(instance);
        }
        public ListRolesResult Unmarshall(XmlUnmarshallerContext context)
        {
            ListRolesResult listRolesResult = new ListRolesResult();
            int             originalDepth   = context.CurrentDepth;
            int             targetDepth     = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Roles/member", targetDepth))
                    {
                        listRolesResult.Roles.Add(RoleUnmarshaller.GetInstance().Unmarshall(context));

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

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

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



            return(listRolesResult);
        }
        public InstanceProfile Unmarshall(XmlUnmarshallerContext context)
        {
            InstanceProfile instanceProfile = new InstanceProfile();
            int             originalDepth   = context.CurrentDepth;
            int             targetDepth     = originalDepth + 1;

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

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

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

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

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

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

                        continue;
                    }
                    if (context.TestExpression("Roles/member", targetDepth))
                    {
                        instanceProfile.Roles.Add(RoleUnmarshaller.GetInstance().Unmarshall(context));

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



            return(instanceProfile);
        }