   require Logger
 
   @pivotal_tracker_api_token Application.get_env(:kairos, :pivotal_tracker_api_token)
+  @toggl_api_token Application.get_env(:kairos, :toggl_api_token)
+  @toggl_workspace_id Application.get_env(:kairos, :toggl_workspace_id)
 
   def get_projects do
     Logger.debug("Getting external projects from services")

  end

  def get_pivotal_traker_projects do
    client = ExTracker.Client.new %{access_token: @pivotal_tracker_api_token}
    projects = client |> ExTracker.Projects.list(fields: ":default,current_velocity")

    {:pivotal_tracker_projects, projects}
  rescue

  end

  def get_toggl_projects do
    projects = %{access_token: @toggl_api_token}
     |> Togglex.Api.Client.new
     |> Togglex.Api.Workspace.projects(@toggl_workspace_id)

    {:toggl_projects, projects}
  end
end
