Class: RecombeeApiClient::ListSearchSynonyms

Inherits:
ApiRequest
  • Object
show all
Defined in:
lib/recombee_api_client/api/list_search_synonyms.rb

Overview

Gives the list of synonyms defined in the database.#

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_hash_to_camel_case

Constructor Details

#initialize(optional = {}) ⇒ ListSearchSynonyms

  • *Optional arguments (given as hash optional)*

    • count -> The number of synonyms to be listed.

    • offset -> Specifies the number of synonyms to skip (ordered by ‘term`).



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 21

def initialize(optional = {})
  optional = normalize_hash_to_camel_case(optional)
  @count = optional['count']
  @offset = optional['offset']
  @optional = optional
  @timeout = 100_000
  @ensure_https = false
  @optional.each do |par, _|
    raise UnknownOptionalParameter.new(par) unless %w[count offset].include? par
  end
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



12
13
14
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 12

def count
  @count
end

#ensure_httpsObject

Returns the value of attribute ensure_https.



13
14
15
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 13

def ensure_https
  @ensure_https
end

#offsetObject (readonly)

Returns the value of attribute offset.



12
13
14
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 12

def offset
  @offset
end

#timeoutObject

Returns the value of attribute timeout.



13
14
15
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 13

def timeout
  @timeout
end

Instance Method Details

#body_parametersObject

Values of body parameters as a Hash



39
40
41
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 39

def body_parameters
  {}
end

#methodObject

HTTP method



34
35
36
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 34

def method
  :get
end

#pathObject

Relative path to the endpoint



54
55
56
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 54

def path
  '/{databaseId}/synonyms/items/'
end

#query_parametersObject

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



45
46
47
48
49
50
51
# File 'lib/recombee_api_client/api/list_search_synonyms.rb', line 45

def query_parameters
  params = {}
  params['count'] = @optional['count'] if @optional['count']
  params['offset'] = @optional['offset'] if @optional['offset']

  params
end