   """
   @spec options(t, query_params_t) :: Hipchat.Httpc.options_t
   def options(client, query_params)
+end
+
+defimpl Hipchat.Client, for: Any do
+  @err "Hipchat.Client protocol is only valid for select struct types."
+  def headers(_), do: raise(@err)
+  def options(_, _), do: raise(@err)
 end
 
 defmodule Hipchat.ApiClient do

  @moduledoc """
  Client protocol used by `ApiClient` and `OauthClient`.
  """

  @type t :: Hipchat.ApiClient.t | Hipchat.OauthClient.t
  @type query_params_t :: [{String.t, String.t}]

      httpc_opts:    httpc_opts,
    }
  end

  alias __MODULE__, as: OC
  defimpl Hipchat.Client do
    def headers(%OC{client_id: ci, client_secret: cs}) do
      encoded = Base.encode64("#{ci}:#{cs}")
      [{"authorization", "Basic #{encoded}"}]
    end

    def options(%OC{httpc_opts: ho}, query_params), do: [{:params, query_params} | ho]
  end
end
