Class: RecombeeApiClient::AddSeries

Inherits:
ApiRequest show all
Defined in:
lib/recombee_api_client/api/add_series.rb

Overview

Creates a new series in the database.#

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_hash_to_camel_case

Constructor Details

#initialize(series_id, optional = {}) ⇒ AddSeries

  • *Required arguments*

    • series_id -> ID of the series to be created.

  • *Optional arguments (given as hash optional)*

    • cascadeCreate -> If set to true, the item will be created with the same ID as the series. Default is true.



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

def initialize(series_id, optional = {})
  @series_id = series_id
  optional = normalize_hash_to_camel_case(optional)
  @cascade_create = optional['cascadeCreate']
  @optional = optional
  @timeout = 3000
  @ensure_https = false
  @optional.each do |par, _|
    raise UnknownOptionalParameter.new(par) unless ['cascadeCreate'].include? par
  end
end

Instance Attribute Details

#cascade_createObject (readonly)

Returns the value of attribute cascade_create.



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

def cascade_create
  @cascade_create
end

#ensure_httpsObject

Returns the value of attribute ensure_https.



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

def ensure_https
  @ensure_https
end

#series_idObject (readonly)

Returns the value of attribute series_id.



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

def series_id
  @series_id
end

#timeoutObject

Returns the value of attribute timeout.



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

def timeout
  @timeout
end

Instance Method Details

#body_parametersObject

Values of body parameters as a Hash



40
41
42
43
44
45
# File 'lib/recombee_api_client/api/add_series.rb', line 40

def body_parameters
  p = {}
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'

  p
end

#methodObject

HTTP method



35
36
37
# File 'lib/recombee_api_client/api/add_series.rb', line 35

def method
  :put
end

#pathObject

Relative path to the endpoint



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

def path
  "/{databaseId}/series/#{@series_id}"
end

#query_parametersObject

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



49
50
51
# File 'lib/recombee_api_client/api/add_series.rb', line 49

def query_parameters
  {}
end