Пример #1
0
        /**
         * Convert CreateQueueRequest to name value pairs
         */
        private IDictionary <String, String> ConvertCreateQueue(CreateQueueRequest request)
        {
            IDictionary <String, String> parameters = new Dictionary <String, String>();

            parameters.Add("Action", "CreateQueue");
            if (request.IsSetQueueName())
            {
                parameters.Add("QueueName", request.QueueName);
            }
            if (request.IsSetDefaultVisibilityTimeout())
            {
                parameters.Add("DefaultVisibilityTimeout", request.DefaultVisibilityTimeout + "");
            }
            List <Attribute> createQueueRequestAttributeList = request.Attribute;
            int createQueueRequestAttributeListIndex         = 1;

            foreach (Attribute createQueueRequestAttribute in createQueueRequestAttributeList)
            {
                if (createQueueRequestAttribute.IsSetName())
                {
                    parameters.Add("Attribute" + "." + createQueueRequestAttributeListIndex + "." + "Name", createQueueRequestAttribute.Name);
                }
                if (createQueueRequestAttribute.IsSetValue())
                {
                    parameters.Add("Attribute" + "." + createQueueRequestAttributeListIndex + "." + "Value", createQueueRequestAttribute.Value);
                }

                createQueueRequestAttributeListIndex++;
            }

            return(parameters);
        }
Пример #2
0
        /**
         * Convert CreateQueueRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertCreateQueue(CreateQueueRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "CreateQueue";
            if (request.IsSetQueueName())
            {
                parameters["QueueName"] = request.QueueName;
            }
            if (request.IsSetDefaultVisibilityTimeout())
            {
                parameters["DefaultVisibilityTimeout"] = request.DefaultVisibilityTimeout.ToString();
            }
            List <Attribute> createQueueRequestAttributeList = request.Attribute;
            int createQueueRequestAttributeListIndex         = 1;

            foreach (Attribute createQueueRequestAttribute in createQueueRequestAttributeList)
            {
                if (createQueueRequestAttribute.IsSetName())
                {
                    parameters[String.Concat("Attribute", ".", createQueueRequestAttributeListIndex, ".", "Name")] = createQueueRequestAttribute.Name;
                }
                if (createQueueRequestAttribute.IsSetValue())
                {
                    parameters[String.Concat("Attribute", ".", createQueueRequestAttributeListIndex, ".", "Value")] = createQueueRequestAttribute.Value;
                }

                createQueueRequestAttributeListIndex++;
            }

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

            dictionary["Action"] = "CreateQueue";
            if (request.IsSetQueueName())
            {
                dictionary["QueueName"] = request.QueueName;
            }
            if (request.IsSetDefaultVisibilityTimeout())
            {
                dictionary["DefaultVisibilityTimeout"] = request.DefaultVisibilityTimeout.ToString();
            }
            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);
        }
Пример #4
0
        /**
         * Convert CreateQueueRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertCreateQueue(CreateQueueRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "CreateQueue";
            if (null == request.QueueName)
            {
                throw new ArgumentNullException("QueueName", "The queue name cannot be null.");
            }

            if (request.IsSetQueueName())
            {
                parameters["QueueName"] = request.QueueName;
            }
            if (request.IsSetDefaultVisibilityTimeout())
            {
                parameters["DefaultVisibilityTimeout"] = request.DefaultVisibilityTimeout.ToString(CultureInfo.InvariantCulture);
            }
            List <Attribute> createQueueRequestAttributeList = request.Attribute;
            int createQueueRequestAttributeListIndex         = 1;

            foreach (Attribute createQueueRequestAttribute in createQueueRequestAttributeList)
            {
                if (createQueueRequestAttribute.IsSetName())
                {
                    parameters[String.Concat("Attribute", ".", createQueueRequestAttributeListIndex, ".", "Name")] = createQueueRequestAttribute.Name;
                }
                if (createQueueRequestAttribute.IsSetValue())
                {
                    parameters[String.Concat("Attribute", ".", createQueueRequestAttributeListIndex, ".", "Value")] = createQueueRequestAttribute.Value;
                }

                createQueueRequestAttributeListIndex++;
            }

            return(parameters);
        }