class RecombeeApiClient::ListUsers

Gets a list of IDs of users currently present in the catalog.

Attributes

count[R]
ensure_https[RW]
filter[R]
included_properties[R]
offset[R]
return_properties[R]
timeout[RW]

Public Class Methods

new(optional = {}) click to toggle source
* *Optional arguments (given as hash optional)*
  - +filter+ -> Boolean-returning [ReQL](https://docs.recombee.com/reql.html) expression, which allows you to filter users to be listed. Only the users for which the expression is *true* will be returned.
  - +count+ -> The number of users to be listed.
  - +offset+ -> Specifies the number of users to skip (ordered by `userId`).
  - +returnProperties+ -> With `returnProperties=true`, property values of the listed users are returned along with their IDs in a JSON dictionary.

Example response: “`

[
  {
    "userId": "user-81",
    "country": "US",
    "sex": "M"
  },
  {
    "userId": "user-314",
    "country": "CAN",
    "sex": "F"
  }
]

“`

- +includedProperties+ -> Allows to specify, which properties should be returned when `returnProperties=true` is set. The properties are given as a comma-separated list.

Example response for `includedProperties=country`: “`

[
  {
    "userId": "user-81",
    "country": "US"
  },
  {
    "userId": "user-314",
    "country": "CAN"
  }
]

“`

# File lib/recombee_api_client/api/list_users.rb, line 57
def initialize(optional = {})
  optional = normalize_optional(optional)
  @filter = optional['filter']
  @count = optional['count']
  @offset = optional['offset']
  @return_properties = optional['returnProperties']
  @included_properties = optional['includedProperties']
  @optional = optional
  @timeout = 100000
  @ensure_https = false
  @optional.each do |par, _|
    fail UnknownOptionalParameter.new(par) unless ["filter","count","offset","returnProperties","includedProperties"].include? par
  end
end

Public Instance Methods

body_parameters() click to toggle source

Values of body parameters as a Hash

# File lib/recombee_api_client/api/list_users.rb, line 78
def body_parameters
  p = Hash.new
  p
end
method() click to toggle source

HTTP method

# File lib/recombee_api_client/api/list_users.rb, line 73
def method
  :get
end
path() click to toggle source

Relative path to the endpoint

# File lib/recombee_api_client/api/list_users.rb, line 96
def path
  "/{databaseId}/users/list/"
end
query_parameters() click to toggle source

Values of query parameters as a Hash. name of parameter => value of the parameter

# File lib/recombee_api_client/api/list_users.rb, line 85
def query_parameters
  params = {}
  params['filter'] = @optional['filter'] if @optional['filter']
  params['count'] = @optional['count'] if @optional['count']
  params['offset'] = @optional['offset'] if @optional['offset']
  params['returnProperties'] = @optional['returnProperties'] if @optional['returnProperties']
  params['includedProperties'] = @optional['includedProperties'] if @optional['includedProperties']
  params
end