Ejemplo n.º 1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketNotificationResponse 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("TopicConfiguration", targetDepth))
                    {
                        response.TopicConfigurations.Add(TopicConfigurationUnmarshaller.Instance.Unmarshall(context));
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }

            return;
        }
Ejemplo n.º 2
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketNotificationResponse response)
        {
            int currentDepth = context.get_CurrentDepth();
            int num          = currentDepth + 1;

            if (context.get_IsStartOfDocument())
            {
                num += 2;
            }
            while (context.Read())
            {
                if (context.get_IsStartElement() || context.get_IsAttribute())
                {
                    if (context.TestExpression("TopicConfiguration", num))
                    {
                        response.TopicConfigurations.Add(TopicConfigurationUnmarshaller.Instance.Unmarshall(context));
                    }
                    else if (context.TestExpression("QueueConfiguration", num))
                    {
                        response.QueueConfigurations.Add(QueueConfigurationUnmarshaller.Instance.Unmarshall(context));
                    }
                    else if (context.TestExpression("CloudFunctionConfiguration", num))
                    {
                        response.LambdaFunctionConfigurations.Add(LambdaFunctionConfigurationUnmarshaller.Instance.Unmarshall(context));
                    }
                }
                else if (context.get_IsEndElement() && context.get_CurrentDepth() < currentDepth)
                {
                    break;
                }
            }
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketNotificationResponse 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("TopicConfiguration", targetDepth))
                    {
                        response.TopicConfigurations.Add(TopicConfigurationUnmarshaller.Instance.Unmarshall(context));
                        continue;
                    }
                    if (context.TestExpression("QueueConfiguration", targetDepth))
                    {
                        response.QueueConfigurations.Add(QueueConfigurationUnmarshaller.Instance.Unmarshall(context));
                        continue;
                    }
                    if (context.TestExpression("CloudFunctionConfiguration", targetDepth))
                    {
                        var cfc = CloudFunctionConfigurationUnmarshaller.Instance.Unmarshall(context);
                        if (cfc == null || cfc.IsSetInvocationRole())
                        {
                            response.CloudFunctionConfigurations.Add(cfc);
                        }
                        else
                        {
                            var lfc = new LambdaFunctionConfiguration
                            {
                                FunctionArn = cfc.CloudFunction,
                                Events      = cfc.Events,
                                Id          = cfc.Id
                            };
                            response.LambdaFunctionConfigurations.Add(lfc);
                        }
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }

            return;
        }
Ejemplo n.º 4
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            GetBucketNotificationResponse getBucketNotificationResponse = new GetBucketNotificationResponse();

            getBucketNotificationResponse.TopicConfigurations = new List <TopicConfiguration>();
            while (context.Read())
            {
                if (context.get_IsStartElement())
                {
                    UnmarshallResult(context, getBucketNotificationResponse);
                }
            }
            return(getBucketNotificationResponse);
        }
Ejemplo n.º 5
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            GetBucketNotificationResponse response = new GetBucketNotificationResponse();

            context.AllowEmptyElementLookup.Add("EventBridgeConfiguration");
            response.TopicConfigurations = new List <TopicConfiguration>();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    UnmarshallResult(context, response);
                    continue;
                }
            }

            return(response);
        }