Class: RecombeeApiClient::DeleteSeries

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

Overview

Deletes the series of the given seriesId from the database.

Deleting a series will only delete assignment of items to it, not the items themselves!

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashNormalizer

#camelize, #normalize_hash_to_camel_case

Constructor Details

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

  • Required arguments

    • series_id -> ID of the series to be deleted.
  • Optional arguments (given as hash optional)

    • cascadeDelete -> If set to true, item with the same ID as seriesId will be also deleted. Default is false.


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/recombee_api_client/api/delete_series.rb', line 25

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

Instance Attribute Details

#cascade_deleteObject (readonly)

Returns the value of attribute cascade_delete.



15
16
17
# File 'lib/recombee_api_client/api/delete_series.rb', line 15

def cascade_delete
  @cascade_delete
end

#ensure_httpsObject

Returns the value of attribute ensure_https.



16
17
18
# File 'lib/recombee_api_client/api/delete_series.rb', line 16

def ensure_https
  @ensure_https
end

#series_idObject (readonly)

Returns the value of attribute series_id.



15
16
17
# File 'lib/recombee_api_client/api/delete_series.rb', line 15

def series_id
  @series_id
end

#timeoutObject

Returns the value of attribute timeout.



16
17
18
# File 'lib/recombee_api_client/api/delete_series.rb', line 16

def timeout
  @timeout
end

Instance Method Details

#body_parametersObject

Values of body parameters as a Hash



43
44
45
46
47
48
# File 'lib/recombee_api_client/api/delete_series.rb', line 43

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

  p
end

#methodObject

HTTP method



38
39
40
# File 'lib/recombee_api_client/api/delete_series.rb', line 38

def method
  :delete
end

#pathObject

Relative path to the endpoint



57
58
59
# File 'lib/recombee_api_client/api/delete_series.rb', line 57

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

#query_parametersObject

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



52
53
54
# File 'lib/recombee_api_client/api/delete_series.rb', line 52

def query_parameters
  {}
end