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_optional

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`.



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

def initialize(series_id, optional = {})
  @series_id = series_id
  optional = normalize_optional(optional)
  @cascade_create = optional['cascadeCreate']
  @optional = optional
  @timeout = 3000
  @ensure_https = false
  @optional.each do |par, _|
    fail 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.



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

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



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

def body_parameters
  p = Hash.new
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional.include? 'cascadeCreate'
  p
end

#methodObject

HTTP method



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

def method
  :put
end

#pathObject

Relative path to the endpoint



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

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
52
# File 'lib/recombee_api_client/api/add_series.rb', line 49

def query_parameters
  params = {}
  params
end