Exemplo n.º 1
0
        private static IDictionary <string, string> ConvertDescribeInstanceHealth(DescribeInstanceHealthRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "DescribeInstanceHealth";
            if (request.IsSetLoadBalancerName())
            {
                dictionary["LoadBalancerName"] = request.LoadBalancerName;
            }
            List <Instance> instances = request.Instances;
            int             num       = 1;

            foreach (Instance instance in instances)
            {
                if (instance.IsSetInstanceId())
                {
                    dictionary[string.Concat(new object[] { "Instances", ".member.", num, ".", "InstanceId" })] = instance.InstanceId;
                }
                num++;
            }
            return(dictionary);
        }
        /**
         * Convert DescribeInstanceHealthRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertDescribeInstanceHealth(DescribeInstanceHealthRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "DescribeInstanceHealth";
            if (request.IsSetLoadBalancerName())
            {
                parameters["LoadBalancerName"] = request.LoadBalancerName;
            }
            List <Instance> describeInstanceHealthRequestInstancesList      = request.Instances;
            int             describeInstanceHealthRequestInstancesListIndex = 1;

            foreach (Instance describeInstanceHealthRequestInstances in describeInstanceHealthRequestInstancesList)
            {
                if (describeInstanceHealthRequestInstances.IsSetInstanceId())
                {
                    parameters[String.Concat("Instances", ".member.", describeInstanceHealthRequestInstancesListIndex, ".", "InstanceId")] = describeInstanceHealthRequestInstances.InstanceId;
                }

                describeInstanceHealthRequestInstancesListIndex++;
            }

            return(parameters);
        }