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_optional

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



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

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



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

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



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

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

#methodObject

HTTP method



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

def method
  :delete
end

#pathObject

Relative path to the endpoint



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

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

def query_parameters
  params = {}
  params
end