 defmodule ExTwilio.Lookup do
   @moduledoc """
-    Repersents the Lookup Api provided by Twilio
+    Represents the Lookup Api provided by Twilio
 
     - [Twilio docs](https://www.twilio.com/docs/api/lookups)
   """

    {:ok, info} = ExTwilio.Lookup.retrieve("12345678910", [Type: carrier])
  """
  def retrieve(phone_number, query \\ []) do
    auth = [ basic_auth: {Config.account_sid, Config.auth_token} ]
    query_string = "?" <> Url.to_query_string(query)

    "#{@base_url}#{phone_number}#{query_string}"

  @base_url "https://lookups.twilio.com/v1/PhoneNumbers/"

  defmodule PhoneNumber do
    @moduledoc false
    defstruct url: nil,
              carrier: nil,
              national_format: nil,
