Sha256: 34a36f743686ade4f2d8597d5aac1f6b66b1e2bffd9b820721dd249d273c53cf

Contents?: true

Size: 1.89 KB

Versions: 22

Compression:

Stored size: 1.89 KB

Contents

module Bearcat
  class Client < Footrest::Client
    module Users

      def list_users(account, params={})
        get("/api/v1/accounts/#{account.to_s}/users", params)
      end

      def user_avatars(user, params={})
        get("/api/v1/users/#{user.to_s}/avatars", params)
      end

      def add_user(account, params={})
        post("/api/v1/accounts/#{account.to_s}/users", params)
      end

      def user_profile(user, params={})
        get("/api/v1/users/#{user.to_s}/profile", params)
      end

      def user_logins(user, params={})
        get("/api/v1/users/#{user.to_s}/logins", params)
      end

      def communication_channels(user, params={})
        get("/api/v1/users/#{user.to_s}/communication_channels", params)
      end

      # scope: food
      # params: {ns: 'com.account-domain.canvas-app'}
      # returns all custom user food scope data. If no scope returns all custom user data
      def load_custom_data(user, params, scope = '')
        get("/api/v1/users/#{user}/custom_data/#{scope}", params)
      end

      # scope: food
      # params: {ns: 'com.account-domain.canvas-app',
      #          data: {'favorite' => 'steak', 'least favorite' => 'water mellon'}}
      # stores custom data in the food scope
      def store_custom_data(user, params, scope = '')
        put("/api/v1/users/#{user}/custom_data/#{scope}", params)
      end

      # scope: food
      # params: {ns: 'com.account-domain.canvas-app'}
      # deletes all custom user data for the food scope. If no scope deletes all custom user data
      def delete_custom_data(user, params, scope = '')
        delete("/api/v1/users/#{user}/custom_data/#{scope}", params)
      end

      def page_views(user, params = {})
        get("/api/v1/users/#{user}/page_views", params)
      end

      def user_merge(user, merge_into_user)
        put("/api/v1/users/#{user}/merge_into/#{merge_into_user}")
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bearcat-1.2.6 lib/bearcat/client/users.rb
bearcat-1.2.5 lib/bearcat/client/users.rb