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

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Marker", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.Marker = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("Parameters/Parameter", targetDepth))
                    {
                        var unmarshaller = ParameterUnmarshaller.Instance;
                        var item         = unmarshaller.Unmarshall(context);
                        response.Parameters.Add(item);
                        continue;
                    }
                }
            }

            return;
        }
コード例 #2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonDocDBConfig config = new AmazonDocDBConfig();

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

            DescribeDBClusterParametersResponse resp = new DescribeDBClusterParametersResponse();

            do
            {
                DescribeDBClusterParametersRequest req = new DescribeDBClusterParametersRequest
                {
                    Marker = resp.Marker
                    ,
                    MaxRecords = maxItems
                };

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

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

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("DescribeDBClusterParametersResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
コード例 #4
0
        public static DescribeDBClusterParametersResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DescribeDBClusterParametersResponse describeDBClusterParametersResponse = new DescribeDBClusterParametersResponse();

            describeDBClusterParametersResponse.HttpResponse = _ctx.HttpResponse;
            describeDBClusterParametersResponse.RequestId    = _ctx.StringValue("DescribeDBClusterParameters.RequestId");
            describeDBClusterParametersResponse.Engine       = _ctx.StringValue("DescribeDBClusterParameters.Engine");
            describeDBClusterParametersResponse.DBType       = _ctx.StringValue("DescribeDBClusterParameters.DBType");
            describeDBClusterParametersResponse.DBVersion    = _ctx.StringValue("DescribeDBClusterParameters.DBVersion");

            List <DescribeDBClusterParametersResponse.DescribeDBClusterParameters_Parameter> describeDBClusterParametersResponse_runningParameters = new List <DescribeDBClusterParametersResponse.DescribeDBClusterParameters_Parameter>();

            for (int i = 0; i < _ctx.Length("DescribeDBClusterParameters.RunningParameters.Length"); i++)
            {
                DescribeDBClusterParametersResponse.DescribeDBClusterParameters_Parameter parameter = new DescribeDBClusterParametersResponse.DescribeDBClusterParameters_Parameter();
                parameter.ParameterName         = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].ParameterName");
                parameter.DataType              = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].DataType");
                parameter.DefaultParameterValue = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].DefaultParameterValue");
                parameter.ParameterValue        = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].ParameterValue");
                parameter.IsModifiable          = _ctx.BooleanValue("DescribeDBClusterParameters.RunningParameters[" + i + "].IsModifiable");
                parameter.ForceRestart          = _ctx.BooleanValue("DescribeDBClusterParameters.RunningParameters[" + i + "].ForceRestart");
                parameter.ParameterStatus       = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].ParameterStatus");
                parameter.CheckingCode          = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].CheckingCode");
                parameter.ParameterDescription  = _ctx.StringValue("DescribeDBClusterParameters.RunningParameters[" + i + "].ParameterDescription");

                describeDBClusterParametersResponse_runningParameters.Add(parameter);
            }
            describeDBClusterParametersResponse.RunningParameters = describeDBClusterParametersResponse_runningParameters;

            return(describeDBClusterParametersResponse);
        }