예제 #1
0
        /**
         * Convert ListQueuesRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertListQueues(ListQueuesRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "ListQueues";
            if (request.IsSetQueueNamePrefix())
            {
                parameters["QueueNamePrefix"] = request.QueueNamePrefix;
            }
            List <Attribute> listQueuesRequestAttributeList = request.Attribute;
            int listQueuesRequestAttributeListIndex         = 1;

            foreach (Attribute listQueuesRequestAttribute in listQueuesRequestAttributeList)
            {
                if (listQueuesRequestAttribute.IsSetName())
                {
                    parameters[String.Concat("Attribute", ".", listQueuesRequestAttributeListIndex, ".", "Name")] = listQueuesRequestAttribute.Name;
                }
                if (listQueuesRequestAttribute.IsSetValue())
                {
                    parameters[String.Concat("Attribute", ".", listQueuesRequestAttributeListIndex, ".", "Value")] = listQueuesRequestAttribute.Value;
                }

                listQueuesRequestAttributeListIndex++;
            }

            return(parameters);
        }
예제 #2
0
        /**
         * Convert ListQueuesRequest to name value pairs
         */
        private IDictionary <String, String> ConvertListQueues(ListQueuesRequest request)
        {
            IDictionary <String, String> parameters = new Dictionary <String, String>();

            parameters.Add("Action", "ListQueues");
            if (request.IsSetQueueNamePrefix())
            {
                parameters.Add("QueueNamePrefix", request.QueueNamePrefix);
            }
            List <Attribute> listQueuesRequestAttributeList = request.Attribute;
            int listQueuesRequestAttributeListIndex         = 1;

            foreach (Attribute listQueuesRequestAttribute in listQueuesRequestAttributeList)
            {
                if (listQueuesRequestAttribute.IsSetName())
                {
                    parameters.Add("Attribute" + "." + listQueuesRequestAttributeListIndex + "." + "Name", listQueuesRequestAttribute.Name);
                }
                if (listQueuesRequestAttribute.IsSetValue())
                {
                    parameters.Add("Attribute" + "." + listQueuesRequestAttributeListIndex + "." + "Value", listQueuesRequestAttribute.Value);
                }

                listQueuesRequestAttributeListIndex++;
            }

            return(parameters);
        }
        private static IDictionary <string, string> ConvertListQueues(ListQueuesRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "ListQueues";
            if (request.IsSetQueueNamePrefix())
            {
                dictionary["QueueNamePrefix"] = request.QueueNamePrefix;
            }
            List <Amazon.SQS.Model.Attribute> list = request.Attribute;
            int num = 1;

            foreach (Amazon.SQS.Model.Attribute attribute in list)
            {
                if (attribute.IsSetName())
                {
                    dictionary[string.Concat(new object[] { "Attribute", ".", num, ".", "Name" })] = attribute.Name;
                }
                if (attribute.IsSetValue())
                {
                    dictionary[string.Concat(new object[] { "Attribute", ".", num, ".", "Value" })] = attribute.Value;
                }
                num++;
            }
            return(dictionary);
        }