          (for [[a-name [a-type a-value]] attrs]
            (prepare-message-attrs a-name a-type a-value)))))
 
-(let [target->elem
-      {:create-queue  [:one :queue-url]
-       :get-queue-url [:one :queue-url]
-       :list-queues   [:many :queue-url]
-       :list-dead-letter-source-queues [:many :queue-url]}]
-  (defn extract-response-value [target resp]
-    (if-let [[tag elem] (target->elem target)]
-      (case tag
-        :one  (x/child-content resp elem)
-        :many (map x/content (x/children resp elem)))
-      resp)))
-
 (defmulti  restructure-response (fn [target body] target))
 (defmethod restructure-response :default [_ body] body)
 

   :change-message-visibility-batch
   {:entries [:list "ChangeMessageVisibilityBatchRequestEntry"]}
   :create-queue
   {:attrs   [:kv   "Attribute" "Name" "Value" #{:enum}]}
   :delete-message-batch
   {:entries [:map  "DeleteMessageBatchRequestEntry"]}
   :get-queue-attributes
   {:attrs   [:list "AttributeName" #{:enum}]}
   :set-queue-attributes

             {:body :body :md-5-of-body :md5
              :receipt-handle :receipt :message-id :id}))
      ;; User-defined attributes
      (assoc :attrs (message-attrs->map message))))

(defmethod restructure-response :receive-message [_ body]
  (for [message (x/children body :message)]
    (restructure-message message)))

(let [target->elem
      {:create-queue  [:one :queue-url]
       :get-queue-url [:one :queue-url]
       :list-queues   [:many :queue-url]
       :list-dead-letter-source-queues [:many :queue-url]}]
  (defn extract-response-value [target resp]
    (if-let [[tag elem] (target->elem target)]
      (case tag
        :one  (x/child-content resp elem)
        :many (map x/content (x/children resp elem)))
      resp)))

(defrecord SQSService [endpoint version max-retries]
  eulalie/AmazonWebService
