module Singly
  class Services
    include Singly::Endpoint

    endpoint :get, "/services"

    def thirtysevensignals(params={})
      service(Singly::Services::ThirtySevenSignals, "37signals", params)
    end

    def bodymedia(params={})
      service(Singly::Services::Bodymedia, __method__, params)
    end

    def dropbox(params={})
      service(Singly::Services::Dropbox, __method__, params)
    end

    def dwolla(params={})
      service(Singly::Services::Dwolla, __method__, params)
    end

    def facebook(params={})
      service(Singly::Services::Facebook, __method__, params)
    end

    def fitbit(params={})
      service(Singly::Services::Fitbit, __method__, params)
    end

    def flickr(params={})
      service(Singly::Services::Flickr, __method__, params)
    end

    def foursquare(params={})
      service(Singly::Services::Foursquare, __method__, params)
    end

    def gcal(params={})
      service(Singly::Services::Gcal, __method__, params)
    end

    def gcontacts(params={})
      service(Singly::Services::Gcontacts, __method__, params)
    end

    def gdocs(params={})
      service(Singly::Services::Gdocs, __method__, params)
    end

    def github(params={})
      service(Singly::Services::Github, __method__, params)
    end

    def gmail(params={})
      service(Singly::Services::Gmail, __method__, params)
    end

    def google(params={})
      service(Singly::Services::Google, __method__, params)
    end

    def gplus(params={})
      service(Singly::Services::Gplus, __method__, params)
    end

    def imgur(params={})
      service(Singly::Services::Imgur, __method__, params)
    end

    def instagram(params={})
      service(Singly::Services::Instagram, __method__, params)
    end

    def klout(params={})
      service(Singly::Services::Klout, __method__, params)
    end

    def linkedin(params={})
      service(Singly::Services::Linkedin, __method__, params)
    end

    def meetup(params={})
      service(Singly::Services::Meetup, __method__, params)
    end

    def paypal(params={})
      service(Singly::Services::Paypal, __method__, params)
    end

    def picasa(params={})
      service(Singly::Services::Picasa, __method__, params)
    end

    def rdio(params={})
      service(Singly::Services::Rdio, __method__, params)
    end

    def reddit(params={})
      service(Singly::Services::Reddit, __method__, params)
    end

    def runkeeper(params={})
      service(Singly::Services::Runkeeper, __method__, params)
    end

    def shutterfly(params={})
      service(Singly::Services::Shutterfly, __method__, params)
    end

    def soundcloud(params={})
      service(Singly::Services::Soundcloud, __method__, params)
    end

    def stocktwits(params={})
      service(Singly::Services::Stocktwits, __method__, params)
    end

    def tout(params={})
      service(Singly::Services::Tout, __method__, params)
    end

    def tumblr(params={})
      service(Singly::Services::Tumblr, __method__, params)
    end

    def twitter(params={})
      service(Singly::Services::Twitter, __method__, params)
    end

    def withings(params={})
      service(Singly::Services::Withings, __method__, params)
    end

    def wordpress(params={})
      service(Singly::Services::Wordpress, __method__, params)
    end

    def yammer(params={})
      service(Singly::Services::Yammer, __method__, params)
    end

    def youtube(params={})
      service(Singly::Services::Youtube, __method__, params)
    end

    def zeo(params={})
      service(Singly::Services::Zeo, __method__, params)
    end

    private

    def service(endpoint_type, service, params)
      params ||= {}
      endpoint = endpoint_type.new(creds.merge(params.merge(service: service.to_s)))
      endpoint.service = service.to_s
      endpoint
    end
  end
end