private static void UnmarshallResult(XmlUnmarshallerContext context, ListQueryLoggingConfigsResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("QueryLoggingConfigs/QueryLoggingConfig", targetDepth))
                    {
                        var unmarshaller = QueryLoggingConfigUnmarshaller.Instance;
                        response.QueryLoggingConfigs.Add(unmarshaller.Unmarshall(context));
                        continue;
                    }
                    if (context.TestExpression("NextToken", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.NextToken = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }

            return;
        }
Example #2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRoute53Config config = new AmazonRoute53Config();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRoute53Client client = new AmazonRoute53Client(creds, config);

            ListQueryLoggingConfigsResponse resp = new ListQueryLoggingConfigsResponse();

            do
            {
                ListQueryLoggingConfigsRequest req = new ListQueryLoggingConfigsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems.ToString()
                };

                resp = client.ListQueryLoggingConfigs(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.QueryLoggingConfigs)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            ListQueryLoggingConfigsResponse response = new ListQueryLoggingConfigsResponse();

            UnmarshallResult(context, response);

            return(response);
        }