def parse_links(json)
      links = json[:links] || json[:link] || json['links'] || json['link']
      return [] if links.nil?

      links = [links] unless links.is_a?(Array)
      links.map do |link|
        if (link[:href].nil? && link['href'].nil?) || (link[:rel].nil? && link['rel'].nil?)
          msg = "Invalid hash link: #{link.inspect}"
          raise(RuntimeError, msg, caller)
        end
        EntryPoint.new(link[:href] || link['href'], link[:rel] || link['rel'])
      end
    end
def parse_links(json)
      links = json[:links] || json[:link] || json['links'] || json['link']
      return [] if links.nil?

      links = [links] unless links.is_a?(Array)
      links.map do |link|
        if (link[:href].nil? && link['href'].nil?) || (link[:rel].nil? && link['rel'].nil?)
          msg = "Invalid hash link: #{link.inspect}"
          raise(RuntimeError, msg, caller)
        end
        EntryPoint.new(link[:href] || link['href'], link[:rel] || link['rel'])
      end
    end
Internal: Parse links from hash. Always normalize to return
 an Array of EntryPoints. Check if link has :href and :rel
 keys.

 Returns Array of EntryPoints or Empty Array if :links not exist.
 Raises RuntimeError if link doesn't have :href and :rel keys.