module Elastic::SiteSearch::Client::User

Public Instance Methods

create_user() click to toggle source

Create a new user for the configured application.

# File lib/elastic/site-search/client.rb, line 225
def create_user
  params = {
    :client_id => Elastic::SiteSearch.platform_client_id,
    :client_secret => Elastic::SiteSearch.platform_client_secret
  }
  post("users.json", params)
end
user(user_id) click to toggle source

Return a user created by the configured application.

@param user_id [String] the Site Search User ID

# File lib/elastic/site-search/client.rb, line 236
def user(user_id)
  params = {
    :client_id => Elastic::SiteSearch.platform_client_id,
    :client_secret => Elastic::SiteSearch.platform_client_secret
  }
  get("users/#{user_id}.json", params)
end
users(options={}) click to toggle source

List users for the configured application.

@param options [Hash] @option options [Integer] :page page number of users to fetch (server defaults to 1) @option options [Integer] :per_page users to return per page (server defaults to 50)

# File lib/elastic/site-search/client.rb, line 216
def users(options={})
  params = {
    :client_id => Elastic::SiteSearch.platform_client_id,
    :client_secret => Elastic::SiteSearch.platform_client_secret
  }
  get("users.json", params.merge(options))
end