def map_response(response, path)
      case path
      when "/audit_entries"
        # Convert returned audit entry href to audit ID
        response.sub!(/^.*\/api\/audit_entries\//, "") if response.is_a?(String)
      when "/tags/by_resource", "/tags/by_tag"
        # Extract tags for each instance resource from response array with members of form
        # {"actions" => [], "links" => [{"rel" => "resource", "href" => <href>}, ...]}, "tags" => [{"name" => <tag>}, ...]
        tags = {}
        if response
          response.each do |hash|
            r = {}
            hash["links"].each { |l| r[l["href"]] = {"tags" => []} if l["href"] =~ /instances/ }
            hash["tags"].each { |t| r.each_key { |k| r[k]["tags"] << t["name"] } } if r.any?
            tags.merge!(r)
          end
        end
        response = tags
      end
      response
    end
def map_response(response, path)
      case path
      when "/audit_entries"
        # Convert returned audit entry href to audit ID
        response.sub!(/^.*\/api\/audit_entries\//, "") if response.is_a?(String)
      when "/tags/by_resource", "/tags/by_tag"
        # Extract tags for each instance resource from response array with members of form
        # {"actions" => [], "links" => [{"rel" => "resource", "href" => <href>}, ...]}, "tags" => [{"name" => <tag>}, ...]
        tags = {}
        if response
          response.each do |hash|
            r = {}
            hash["links"].each { |l| r[l["href"]] = {"tags" => []} if l["href"] =~ /instances/ }
            hash["tags"].each { |t| r.each_key { |k| r[k]["tags"] << t["name"] } } if r.any?
            tags.merge!(r)
          end
        end
        response = tags
      end
      response
    end
Convert response from request into required form where necessary

 @param [Object] response received
 @param [String] path in URI for desired resource

 @return [Object] converted response